Configuring TLS/SSL Client Authentication
- Last Updated: March 29, 2021
- 2 minute read
- DataDirect Connectors
- JDBC
- Documentation
If the server is configured for TLS/SSL client authentication, the server asks the client to verify its identity after the server has proved its identity. Similar to TLS/SSL server authentication, the client sends a public certificate to the server to accept or deny. The client stores its public certificate in an encrypted file known as a keystore.
The driver must be able to locate the keystore and unlock the keystore with the appropriate keystore password. Depending on the type of keystore used, the driver also may need to unlock the keystore entry with a password to gain access to the certificate and its private key.
The drivers can use the following types of keystores:
- Java Keystore (JKS) contains a collection of certificates. Each entry is identified by an alias. The value of each entry is a certificate and the certificate’s private key. Each keystore entry can have the same password as the keystore password or a different password. If a keystore entry has a password different than the keystore password, the driver must provide this password to unlock the entry and gain access to the certificate and its private key.
- PKCS #12 keystores. To gain access to the certificate and its private key, the driver must provide the keystore password. The file extension of the keystore must be .pfx or .p12.
You can specify this information in either of the following ways:
- Specify values for the Java system properties javax.net.ssl.keyStore and
javax.net.ssl.keyStorePassword. For example:
java -Djavax.net.ssl.keyStore=C:\Certificates\MyKeystore -Djavax.net.ssl.keyStorePassword=MyKeystorePasswordThis method sets values for all TLS/SSL sockets created in the JVM.
KeyPassword=MyKeyPassword).- Specify values for the connection properties KeyStore and KeyStorePassword
in the connection URL. For example:
KeyStore=C:\Certficates\MyKeyStoreand
KeyStorePassword=MyKeystorePassword
KeyPassword=MyKeyPassword).Any values specified by the KeyStore and KeyStorePassword properties override values specified by the Java system properties. This allows you to choose which keystore file you want to use for a particular connection.