Hello there
My tomcat dependency is
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>7.0.57</version>
</dependency>
In my code, I set the connector properties as
LOGGER.debug("ksPath=>" + ksPath);
httpsConnector.setAttribute("keystoreFile",ksPath);
httpsConnector.setAttribute("keystorePass", keyStorePass);
httpsConnector.setAttribute("clientAuth", "false");
httpsConnector.setAttribute("sslProtocol", "TLS");
httpsConnector.setAttribute("sslEnabledProtocols", tlsProtocols);
httpsConnector.setAttribute("SSLEnabled", true);
Connector defaultConnector = tomcat.getConnector();
defaultConnector.setRedirectPort(port);
When I server deployed, I see
ksPath=>jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore
and then failure as
SEVERE: Failed to load keystore type JKS with path
/shn/lp/jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore
due to
/shn/lp/jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore
(No such file or directory)
java.io.FileNotFoundException:
/shn/lp/jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore
(No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:413)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:319)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:577)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:517)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:462)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:209)
Now, Observed that there are differences in ksPath and path tomcat looks
for
ksPath=>jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore
and
java.io.FileNotFoundException:
/shn/lp/jar:file:/shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar!/my.keystore
(No such file or directory)
the tomcat path looks inside /shn/lp (which is current directory)
I also see that the keystone file is in fact present
jar -tvf /shn/lp/main-1.0-SNAPSHOT-jar-with-dependencies.jar | grep my.keystore
4704 Tue Jun 09 09:29:26 PDT 2015 my.keystore
What is the issue and how do I resolve it?
Thank you very much in advance
+ Harit Himanshu