Follow below simple two steps in enable SSL in your tomcat server. Generally to enable SSL we required certificate, in this example we are using our own key. We can use Java keytool.exe (Java\jdk1.7.0_06\bin\keytool.exe) to generate certificate.
Use below command to generate keys
keytool -genkey -alias pretech -keyalg RSA -keystore c:\vinod
Option details:
-genkey= Generate keys
-alias= Giving unique alias for keystore
-keyalg= To define algorithm (eg RSA_
-keystore=Location to store certificate
Step1 - Generate Key
Step 2- Configure Tomcat Server.xml
Replace connector details in your tomcat\conf\server.xml
<Connector port="8080" protocol="HTTP/1.1" SSLEnabled="true"maxThreads="150" scheme="https" secure="true"clientAuth="false" sslProtocol="TLS"keystoreFile="c:\vinod"keystorePass="xxxxxx" />
Note: Replace kestorePass xxxxxx with your password which is used during key generation.
Start tomcat
Start your tomcat server and check the admin console with https. We can see SSL is enabled.
No comments:
Post a Comment