My Oracle Support Banner

How To Specify The Truststore And Keystore For A JDBC SSL Connection Using The Same File? (Doc ID 2810988.1)

Last updated on OCTOBER 05, 2021

Applies to:

JDBC - Version 12.1.0.2.0 and later
Information in this document applies to any platform.

Goal

An Oracle wallet is exported to a keystore and truststore with:

orapki wallet pkcs12_to_jks -wallet wallet -pwd xxx -jksTrustStoreLoc /tmp/truststore.jks -jksTrustStorepwd -jksKeyStoreLoc /tmp/keystore.jks -jksKeyStorepwd

and then the java program is run with the following options:

java -cp .:ojdbc8.jar \
-Doracle.net.ssl_server_dn_match="false" \
-Doracle.net.ssl_version='1.2' \
-Djavax.net.ssl.trustStore="/tmp/javatest/truststore.jks" \
-Djavax.net.ssl.trustStorePassword="<PASSWORD>" \
-Djavax.net.ssl.trustStoreType="JKS" \
-Djavax.net.ssl.keyStore="/tmp/javatest/keystore.jks" \
-Djavax.net.ssl.keyStorePassword="<PASSWORD>" \
-Djavax.net.ssl.keyStoreType="JKS" <CLASS NAME>

How can the program be executed if not using a keystore file but only a truststore file?

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.