Client migration to Java sdk 3.0, sslKeystoreFie and password

I’m trying to migrate our existing cb client from v2 to 3. (our server is 6.0.1)
For security configuration we use ssl keystore file and ssl keystore password.
How are these params translated to the new v3 security config? I’m not able to find any reference to keystore in the code.
The docs hint that this is moved to CertificateAuthenticator but this is not clear how.


Hi Asher,

Are you just enabling SSL/TLS, or are you also authenticating the client using a certificate instead of a username & password?


Hi David,

Previously we used sslKeystoreFile and password for ssl, user/password for authentication

@ashernave in the next release we brought those APIs back for convenience:

If you don’t want to wait for that you can use the same code that we use internally to build up the factory and supply it.

Something along the lines of

final KeyStore store = KeyStore.getInstance(trustStoreType.orElse(KeyStore.getDefaultType()));
          trustStorePassword != null ? trustStorePassword.toCharArray() : null

final TrustManagerFactory tmf = TrustManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());

and then pass the tmf to the API ( … again in the next version it will remove that boilerplate

Thanks, this is very helpful.
When can I expect the next version be released?

@ashernave currently targeting first tuesday of april. (for the java sdk, we try to do monthly releases on the first tuesday of the month if possible/feasible)

How i can pass the Keystore and trustore file and password for cert based authentication as parameters not the actual path.

Hi @Shruti_Dixit ,

You can use the overloads that accept a KeyStore instead of a Path, namely: SecurityConfig.trustStore(KeyStore) and CertificateAuthenticator.fromKeyStore(KeyStore, String).

To turn a File into a KeyStore:

public static KeyStore readKeyStore(File file, char[] password) throws Exception {
  try (InputStream is = new FileInputStream(file)) {
    KeyStore store = KeyStore.getInstance(KeyStore.getDefaultType());
    store.load(is, password);
    return store;


Please let me know are you able to achieve TLS connection from java SDK 3.* clients.
It will be helpful, if I can get some steps and sample as I am facing handshake failure.