May 15, 2017

Configure Java KeyStore and TrustStore

KeyStore

javax.net.ssl.keyStore
javax.net.ssl.keyStorePassword
javax.net.ssl.keyStoreType Typical [JKS|PKCS12]
javax.net.ssl.keyStoreProvider Rarely used, example sun.security.mscapi.SunMSCAPI

TrustStore

javax.net.ssl.trustStore
javax.net.ssl.trustStorePassword
javax.net.ssl.trustStoreType Typical [JKS|PKCS12]
javax.net.ssl.trustStoreProvider Rarely used, example sun.security.mscapi.SunMSCAPI

Miscellaneous

javax.net.debug [ssl|debug|all]
jdk.tls.client.protocols E.g. TLSv1,TLSv1.1

And how to use it.

$ java -Djavax.net.ssl.keyStore=/path/to/file \
	-Djavax.net.ssl.keyStorePassword=changeit \
	-Djavax.net.ssl.keyStoreType=PKCS12 \
	-Djavax.net.ssl.trustStore=/path/to/file \
	-Djavax.net.ssl.trustStorePassword=changeit \
	-Djavax.net.ssl.trustStoreType=JKS


Reference: Java Secure Socket Extension (JSSE) Reference Guide Customizing JSSE

No comments: