permaculture playing cards*
The moose likes Tomcat and the fly likes Trouble teting secure environment for Tomcat 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Trouble teting secure environment for Tomcat 6" Watch "Trouble teting secure environment for Tomcat 6" New topic
Author

Trouble teting secure environment for Tomcat 6

Mike Tabak
Ranch Hand

Joined: Mar 31, 2012
Posts: 43
I am trying to test a secure connection to Tomcat. I am generating a .keystore file in my home directory using the command %JAVA_HOME%/bin/keytool -genkey -alias -keyalg RSA using "changeit' as the password. The file is being generated in my home directory. I then uncomment the following in my server.xml file:


<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />




Just running up Tomcat gives me the following execption

SEVERE: Error initializing endpoint
java.lang.Exception: No Certificate file specified or invalid file format
at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method)
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:733)
at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:107)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1049)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Oct 16, 2012 2:18:49 PM org.apache.catalina.core.StandardService initialize
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]]
LifecycleException: Protocol handler initialization failed: java.lang.Exception: No Certificate file specified or invalid file format
at org.apache.catalina.connector.Connector.initialize(Connector.java:1051)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Oct 16, 2012 2:18:49 PM org.apache.coyote.ajp.AjpAprProtocol init


Indicating there is some error with the .keystore file, but I have not idea what it is. Any suggesions?

thanks
Mike
Mike Tabak
Ranch Hand

Joined: Mar 31, 2012
Posts: 43
Got it working folks, thanks anyway.

Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble teting secure environment for Tomcat 6