Windows Apache Tomcat SSL HTTPS in two minutes

These instructions
are for just encrypting the
communication.

These instructions
will not create a trusted
certificate.

Refer: 
http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html
for creating trusted certificates.

 

 

1)     
Run

%JAVA_HOME%\bin\keytool
-genkey -alias tomcat -keyalg RSA

Specify a password value of “changeit“.

Provide all other information

In “Enter key password for
<tomcat>” just press enter. DO NOT Enter another
password.

The command will create a new file,
in the home directory named .keystore

 

2)     
Create the directory

keystore in c:\

 

3)     
Copy .keystore from home
directory of the user
to c:\keystore\

 

4)     
Open

C:\Program
Files\Apache Software Foundation\Tomcat 5.5\conf\server.xml

 

5)     
Find

<!–
Define a SSL HTTP/1.1 Connector on port 8443 –>

 

6)     
Add bellow the following,

 

<Connector

       
Port=”8443″ maxThreads=”200″

        scheme=”https”
secure=”true” SSLEnabled=”true”

        
keystoreFile=”c:/keystore/.keystore” keystorePass=”changeit”

         clientAuth=”false”
sslProtocol=”TLS”/>

 

7)     

Save File

 

8)      
Restart Tomcat as normally                        

               

9)     
Visit https://localhost:8443

 

 

 

References:

http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html