How do I enable SSL https in Tomcat server running on Windows Platform so that Securonix Application runs only on port 8443? And the application can be accessed by the url https://localhost:8443?

asked 29 May '13, 14:48

Sruthin's gravatar image

accept rate: 25%

SSL can be enabled in Tomcat running on Windows by the following procedure : 1. Run the command on the command prompt :
keytool -genkey -keyalg RSA -alias localhost -keystore keystore.jks -validity 999 -keysize 2048

You will receive a set of questions starting with a prompt for a password.
Enter keystore password:
Re-enter new password:

Fill out the details as required and preserve a copy of the questions and their answers for future reference.

This will create a file keystore.jks in the folder where the above command was executed.
1. In the Tomcat/conf/server.xml file make the changes as mentioned below :
Please remember to turn off Tomcat when the changes are being made.
Comment out the line :
<connector port="8080" protocol="HTTP/1.1" connectiontimeout="20000" redirectport="8443"/>
Uncomment the lines :

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" />

and append lines in the Connector tag    </br>
maxHttpHeaderSize="8192" keystoreFile="path\to\keystore.jks" 
keystorePass="password entered earlier on configuring the certificate"

Add the following lines in the Tomcat/webapps/ROOT/index.jsp before the beginning of the html tag.
<% String redirectURL = "/Profiler"; response.sendRedirect(redirectURL); %>

Restart Tomcat and access Securonix application using url :"


answered 29 May '13, 16:20

Sruthin's gravatar image

accept rate: 25%

edited 29 May '13, 20:28


answered 30 May '13, 10:26

Praful's gravatar image

Praful ♦♦
accept rate: 5%

to set up port forwarding from 8080 to 8443 add the following line to web.xml and also make uncomment the lines in server.xml

lines to add in web.xml :: <security-constraint> <web-resource-collection> <web-resource-name>Everything in https</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>


answered 16 Sep '13, 22:35

mnair's gravatar image

accept rate: 9%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 29 May '13, 14:48

Seen: 8,638 times

Last updated: 16 Sep '13, 22:35