Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to configure my Spring application to use an SSL certificate I purchased from a CA. I followed the directions for the Tomcat 6.0 configuration and have imported the key into my Tomcat keystore and uncommented the SSL connector in the server.xml. When I start Tomcat, I see the connector start on port 8443 in the Tomcat logs, but when I go to https ://example.com:8443 or http: //example.com:8443 or https: //example.com (without the spaces - I don't have the reputation to post links), it times out. What other configuration do I need to do to enable SSL for my Spring application. Do I have to change the application configuration?

I'd also like to only have some URLs over SSL (login, edit profile, etc.). How can I allow this in the Spring configuration? If I have to have all URLs accessible over SSL, that would be ok, but not desirable. I haven't found any tutorials that are Spring specific.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

There are two things that need to be in the Tomcat keystore: 1. The private key and the public key pair that was generated (usually generated by the keytool -genkeypair command). 2. The certificate signing the public key (imported from the CA's reply using the keytool -importcert command).

Assuming that the above two are correct, you might want to figure out more details on why the connection is timing out. Is the SSL/TLS-enabled port accessible at example.com:8443 or is it listening on a different network interface? Moreover, are all the attributes specified for the Connector correct (the Tomcat logs would provide a hint or two)? Finally, you might want to use the javax.net.debug flag when starting the JVM to determine if there are any other reasons for the connection timeout.

share|improve this answer
    
The problem was my firewall rules - I updated it to allow port 8443 and it worked properly. –  Wallace Sean May 31 '11 at 19:15

Wouldn't you do the URI-specific SSL configuration using standard security constraints in your web.xml file?

share|improve this answer
    
Does not appear so based on my perusing of web.xml. –  Brian Knoblauch Nov 1 '12 at 17:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.