I'm setting up a test environment with Tomcat6 + SSL on Eclpse
I edited the server.xml file (in Eclipse server folder) and uncommented the SSL connector. I then made a self signed certificate following this how-to. Everything works fine until I keep the keystore file in my home directory but, when I try placing it in another folder and I set the "keystoreFile" parameter i get this error message at startup:
GRAVE: Failed to load keystore type JKS with path C:\Documents and Settings\myUser/.keystore due to C:\Documents and Settings\myUser\.keystore (Impossibile trovare il file specificato)
java.io.FileNotFoundException: C:\Documents and Settings\myUser\.keystore (Impossibile trovare il file specificato)
It seems Tomcat doen't read my keystoreFile parameter.
here is my server.xml file (SSL related parts only)
...
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
...
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="C:\myPath\.keystore"
keystorePass="******" />
...
Update
I exported my project as a .war file and deployed it on a stand-alone Tomcat. It works so it must be Eclipse the cause of my problem. If it may help I'm using Eclipse Helios (Service Release 2).
Thanks.
Epilogue
At last it came out, thanks to Bruno, that it was Eclipse messing up with deploying files. After cleaning eclipse deploy folder everything worked.
keystoreFile has no effect since you're using the APR connector (AprLifecycleListener), which uses a different set of parameters than the JSSE connector.
In particular, it doesn't use keystoreFile, but OpenSSL-style parameters (similar to Apache Httpd's mod_ssl configuration): you'll need to convert your keys and certificates for it to work with the APR connector.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With