We are moved to new domain
Click -> www.ehowtonow.com
Saturday, 3 August 2013

Configure Tomcat to support SSL or HTTPS



We will see how to configure Tomcat to support SSl or Https using Keystore command

1.Gegerate Keystore File

Create Key store file using keytool command for self-signed certificate.Follow the steps mentioned below to generate key store file

<$Tomcat-Home>\bin>keytool -genkey -alias javatutorialscorner -keyalg RSA -keystore c:\javatutorialscornerstore
Enter keystore password:
Re-enter new password:
What is your first and last name?
  [Unknown]:  Java Tutorials Corner
What is the name of your organizational unit?

….

  [no]:  yes

Enter key password for <javatutorialscorner >
        (RETURN if same as keystore password):
Re-enter new password:

<$Tomcat-Home>\bin>
keystore
Now your keystore file ready to use.you can find your key store file at mentioned location

2.Edit connector in server.xml

you can find your server.xml  at your <tomcat home>/conf folder .
connector in server.xml befor edit
<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
server xml _1
Edit port 8080 to 80.If your using port 80 you don’t need to mention port in url
<Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

connector_port80
Add the following content just below the connector for configure your key store file with tomcat
1.keystoreFile - keystore file location
2.keyAlias - alias name given by you
3.keystorePass - password given by you

               <Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               keyAlias="javatutorialscorner" keystoreFile="C:\javatutorialscornerstore" keystorePass="PASSWORD"
               clientAuth="false" sslProtocol="TLS" />
ssl_config
Now your tomcat ready to support SSL/Https.Start tomcat just give https://localhost ,you can see the following warning page
tomcat_warning
Click I Understand the risk and add exception then it will go to tomcat home page thats it
add exception
tomcat home page

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer
Newer Post
Previous
This is the last post.
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: Configure Tomcat to support SSL or HTTPS Rating: 5 Reviewed By: eHowToNow