Reputation: 720
I'm using a Tomcat server to host a Spring application and need to add the truststore directly into the JVM.
I modified my setenv.sh
to have :
CATALINA_OPTS=$CATALINA_OPTS" -Djavax.net.ssl.trustStore=/home/osadmin/trustore"
CATALINA_OPTS=$CATALINA_OPTS" -Djavax.net.ssl.trustStorePassword=changeit"
But ended up with the following error each time I tried to connect to the AD I need to connect to.
Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
My truststore was created in KeyStore Explorer
and I imported each public certificate I needed. It was then downloaded on the server and the right all set to a+wrx
to test.
The full debug with command debug=all
+ grep -i truststore
showed the following lines
cat /opt/application/XXXXX/XXXXX/tomcat/00/logs/catalina.out | grep -i truststore
03-Jun-2020 18:20:42.431 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djavax.net.ssl.trustStore=/home/osadmin/trustore
03-Jun-2020 18:20:42.431 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djavax.net.ssl.trustStorePassword=changeit
trustStore is: No File Available, using empty keystore.
trustStore type is : jks
trustStore provider is :
init truststore
trustStore is: No File Available, using empty keystore.
trustStore type is : jks
trustStore provider is :
Yet it exists :
How can I set the truststore correctly ?
Upvotes: 0
Views: 613
Reputation: 720
It seems to be a very simple matter of rights.
+w on above folders so they can navigate through them.
Upvotes: 1