File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 6 - Configuration of SSL

 
Glen Iris
Ranch Hand
Posts: 168
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys,

I am having problems setting up my Tomcat with SSL. I would really appreciate some help with it. I am using Tomcat 6 on Windows 7. Below are the steps I have taken so far:

1 - Generated a .keystore file.
2 - In server.xml file I uncommented the SSL connector and configured it as follows:



When I startup Tomcat I see three errors in the log. They are:

1
SEVERE: Error initializing endpoint
java.lang.Exception: No Certificate file specified or invalid file format
at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method)


and 2

SEVERE: Error starting endpoint
java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:649)


and 3
SEVERE: Failed to start connector [Connector[HTTP/1.1-8443]]
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.


I think if i fix the first error I will be in business. However, I have been rooting around for a few hours searching for solutions and trying different things but with no success. I would greatly appreciate your help.

Thanks,

G
 
K. Gil
Ranch Hand
Posts: 75
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2 hints:

1) because it's windows
try to put keystore in directories without spaces

2) because socket bind exceptions
make sure that nothing else listen on that port, and make sure you don't have two connectors on the same port

 
Glen Iris
Ranch Hand
Posts: 168
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks K but unfortunately that hasn't helped. I did try both of those things before posting. I appreciate your help all the same

Any other ideas anybody?

Thanks,

G
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you get a "socket in use" error, either some other app is already listening on that socket ("There Can Be Only One!"), you didn't fully shut down Tomcat previously, or you attempted 2 different services to use the same socket; for example, if you had uncommented a Connector definition but someone else had already inserted a Connector definition of their own into that server.xml.

On the keystore, try using the command-line keytool utility to open and list what's in the keystore using the full path. That is:

keytool -k "C:/Program Files (x86)/Apache Software Foundation/apache-tomcat-6.0.36/conf/keystore/.keystore" ....

If that works, check that the keystore can be accessed by the userID that Tomcat runs under.
 
Glen Iris
Ranch Hand
Posts: 168
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Tim,

thanks for the advice. I couldnt figure it out so installed my JDK and tomcat again, started from scratch and got going....ish.

My next issue is that when I hit the url localhost:8443, nothing opens up but a file downloads named 'download'.

Do you have any ideas?

g
 
Glen Iris
Ranch Hand
Posts: 168
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got a resolution.

I get the file name 'download' when I go to

http://localhost:8080/

I get the page I was expecting when I go to

https://localhost:8080/



thanks guys
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic