SSL ya Tomcat
Steps to enable SSL for your tomcat
1. Generate SSL key for your computer.
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore /path/to/my/keystore
Reminder: check ../tomcat/conf/tomcat-user.xml for tomcat user’s password
2. Edit server.xml
– Open ../tomcat/conf/server.xml
– Uncomment following lines and add in “keystoreFile” and “keystorePass”
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" keystoreFile="/path/to/my/keystore" keystorePass="password" clientAuth="false" sslProtocol="TLS" />
3. You are DONE. You can try to access HTTPS with Port 8443 now.
Eg: https://www.example.com/SecretResource/1234567
Reference: Tomcat 6.0 SSL Configuration, here.
My environment:
Apache Tomcat v6.0.32
Sun Java v1.6.0_21
Red Hat 4.1.2-50
Leave a Reply