Configuring SSL in Tomcat


SSL, or Secure Socket Layer, is a technology which allows web browsers and web servers to communicate over a secured connection. It means that the data which is being sent will be encrypted and transmitted in one side and decrypted at the reciever side. The other important feature of SSL is that during the intial communication with in browser and server the credentials are authenticated before actual transmission started. This authentication credentials are in the form of certificate sent to server and server will check the certificates before allowing any communication.


The following are the steps for configuring SSL in tomcat. By default the SSL is disabled in tomcat.


1.Create a certificate keystore from the java by executing the following command:











keytool -genkey -alias tomcat -keyalg RSA


2. Uncomment the "SSL HTTP/1.1 Connector" entry in conf/server.xml and restart the server. The entry is as follows:-


    <Connector port="8443" maxHttpHeaderSize="8192"

               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

               enableLookups="false" disableUploadTimeout="true"

               acceptCount="100" scheme="https" secure="true"

               clientAuth="false" sslProtocol="TLS" />


Note:- Please make a note of it. All the SSL request should be run from https:// protocol and not with simple http://. So all request which need to be processed with SSL should have the address in browser as https://servername;port/applicationpage

                    

Copyright © 2012 VisualBuilder. All rights reserved