Setting up Tomcat with SSL on Eclipse: “keystoreFile” has no effect
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="******" /> ...
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).
At last it came out, thanks to Bruno, that it was Eclipse messing up with deploying files. After cleaning eclipse deploy folder everything worked.
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.