This is a short guide about configuring tomcat to support SSL and run portal over https.
BR,
Hamid
Source: http://stackoverflow.com/ questions/1180397/tomcat- server-client-self-signed-ssl- certificate
- Install latest tomcat (I use 7.0.8). There is no separate "SSL support" version. It's already included.
- Create a folder in tomcat directory (lets say "cert"): C:\Programs\apache-tomcat-7.0.
8\cert
- Cd into "cert", and run these commands in a windows prompt. You need to either have java bin folder in your path, or specify the full path to keytool (for example "C:\Program Files\Java\jdk1.7.0_07\bin\
keytool")
keytool -genkeypair -alias servercert -keyalg RSA -dname "CN=Web Server,OU=Unit,O=Organization,
L=City,S=State,C=US" -keypass password -keystore server.jks -storepass password -validity 3650
keytool -genkeypair -alias tomcat -keystore tomcat.p12 -storetype pkcs12 -keyalg RSA -dname "CN=tomcat,OU=Unit,O=
Organization,L=City,S=State,C=
US" -keypass password -storepass password -validity 3650
keytool -exportcert -alias tomcat -file tomcat.cer -keystore tomcat.p12 -storetype pkcs12 -storepass password
keytool -importcert -keystore server.jks -alias tomcat -file tomcat.cer -v -trustcacerts -noprompt -storepass password
keytool -list -v -keystore server.jks -storepass password
del tomcat.cer
- Check that you have these files in "cert":
server.jks
tomcat.p12
- Edit C:\Programs\apache-tomcat-7.0.
8\conf\server.xml and add a new connector:
<Connector protocol="org.apache.coyote.
http11.Http11NioProtocol"
port="8443" SSLEnabled="true"
maxThreads="200" scheme="https" secure="true"
keystoreFile="\cert\server.
jks" keystorePass="password"
clientAuth="false" sslProtocol="TLS" />
- Start tomcat.
Now in a browser, instead of usual URL:
http://localhost/portal-root- war/index_mock.html?deviceId= 82:64:61:79:68:69&type=plain
Try https (don't forget to add port 8443):
https://localhost:8443/portal- root-war/index_mock.html? deviceId=82:64:61:79:68:69& type=plain
Now portal should be loaded and all requests should be over https!
BR,
Hamid
Source: http://stackoverflow.com/
- Install latest tomcat (I use 7.0.8). There is no separate "SSL support" version. It's already included.
- Create a folder in tomcat directory (lets say "cert"): C:\Programs\apache-tomcat-7.0.
- Cd into "cert", and run these commands in a windows prompt. You need to either have java bin folder in your path, or specify the full path to keytool (for example "C:\Program Files\Java\jdk1.7.0_07\bin\
keytool -genkeypair -alias servercert -keyalg RSA -dname "CN=Web Server,OU=Unit,O=Organization,
keytool -genkeypair -alias tomcat -keystore tomcat.p12 -storetype pkcs12 -keyalg RSA -dname "CN=tomcat,OU=Unit,O=
keytool -exportcert -alias tomcat -file tomcat.cer -keystore tomcat.p12 -storetype pkcs12 -storepass password
keytool -importcert -keystore server.jks -alias tomcat -file tomcat.cer -v -trustcacerts -noprompt -storepass password
keytool -list -v -keystore server.jks -storepass password
del tomcat.cer
- Check that you have these files in "cert":
server.jks
tomcat.p12
- Edit C:\Programs\apache-tomcat-7.0.
<Connector protocol="org.apache.coyote.
port="8443" SSLEnabled="true"
maxThreads="200" scheme="https" secure="true"
keystoreFile="\cert\server.
clientAuth="false" sslProtocol="TLS" />
- Start tomcat.
Now in a browser, instead of usual URL:
http://localhost/portal-root-
Try https (don't forget to add port 8443):
https://localhost:8443/portal-
Now portal should be loaded and all requests should be over https!