Howto: Install ssl with tomcat Appserver.

Posted on Updated on

Five easy steps to enable SSL for tomcat application server.

1, generate Key store

keytool -genkey -alias server -keyalg RSA -keysize 2048 -keystore planetcure-in.jks

It ask few information that we would like to publish along with the SSL

==Certificate information==

Common Name : *.planetcure.in
Organization name: Xtermpro
Country/Region name: myregion
City/Locality: mycity
State/Province: mystate

2, Generate CSR

CSR it to submit to the SSL provider for digital signing Now you receive CRT file from the SSL provider, you may see the signing information in it.

keytool -certreq -alias server -file planetcure-in.csr -keystore planetcure-in.jks

3, Import CA

You may also receive a public CA from the certificate Authority, now you need to import it. This will be called as intermediate CA

keytool -import -alias intermediate -trustcacerts -file intermediateCA.cer  -keystore planetcure-in.jks

4, Now this is the final stage you have to import cert file , you can see that their is another key already installed in the key store that is generated along with the keystore generation, it have to replace with the valid certificate.

keytool -import -alias server -trustcacerts -file planetcure-in.crt -keystore planetcure-in.jks

This will give the success output, now move to the configuration changes.

5, Edit the server.xml for the valid entries.  Default tomcat SSL port is 8443, here I user 443 .

<Connector port="443"
           protocol="HTTP/1.1"
           maxThreads="150"
           scheme="https" secure="true" SSLEnabled="true"       
           keystoreFile="${catalina.home}/conf/keystore/planetcure-in.jks"
           keystorePass="keystorepassword" keyAlias="server"
           clientAuth="false" sslProtocol="TLS"/>

that’s it, now restart the web server to make the changes effect .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s