java driver keystore alias

73 views
Skip to first unread message

Dan

unread,
May 17, 2017, 5:43:37 AM5/17/17
to mongodb-user
Hi
Using a the mongodb java driver is there a way to specify what key in a keystore to use when authenticating the client connection?
If the keystore is a jks file each key has an alias. Is there a way to tell the the client what alias to use?

regards
Dan


Wan Bachtiar

unread,
Jun 26, 2017, 8:09:39 PM6/26/17
to mongodb-user

Is there a way to tell the the client what alias to use?

Hi Dan,

Are you referring to the use of keyStore for JKS SSL ?

Normally, in your Java application you specify these settings as system properties, see below example:

System.setProperty("javax.net.ssl.trustStoreType", "jks");
System.setProperty("javax.net.ssl.trustStore", "/path/to/mongodb-truststore.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "password");
System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
System.setProperty("javax.net.ssl.keyStore", "/path/to/client.pkcs12");
System.setProperty("javax.net.ssl.keyStorePassword", "password");

If you look at the Customisation section for the JSSE (v8) Guide, there is no Java.net.ssl for alias or keyStoreAlias property settings. Also these are set on the Java side itself, not on the driver side. Your application has to load them explicitly.

If you still have further questions, please provide code examples and setup on what you’re trying to do.

Regards,

Wan.

Reply all
Reply to author
Forward
0 new messages