SSL IN TOMCAT

WHAT IS SSL?

The acronym ‘ssl‘ stands for Secure Socket Layer which is the industry standard for creating secure connection between the client an the server. So any data that is passed through a secured connection cannot be accessed by any intruders. All the data to be transmitted is first encrypted and then it will send to the destination. At the destination these data should be decrypted to access as well. So no one except the specific receiver can access the data. So ssl make sure the data which is being transmitted is secure.

HTTP AND HTTPS?

Normally when we browse a web site it will show as the http://url. But sometimes it could be changed to something like https://url. The main difference between these two is that https use ssl to make the connection secure. So if you browse using https:// then your data is secure. The default port for http is 80 and the default port for https is 443.

There are some few differences in https as well.

  • Customer information, like credit card numbers, is encrypted and cannot be intercepted.
  • Visitors can verify you are a registered business and that you own the domain.
  • Customers are more likely to trust and complete purchases from sites that use HTTPS.
  • https sites are slightly faster than http sites.
  • Google prefer https sites, so it will help in Search Engine Optimization (SEO) as well.

HOW TO ENABLE ssl IN tomcat

Tomcat is an application server from the Apache Software Foundation that executes Java servlets and renders Web pages that include Java Server Page coding. So enabling ssl in tomcat make the connection secure. Let’s see how to do it.

  • To make ssl enable we should create a special key for our connection. JAVA gives a way to create a key using it’s keytool. -keystore then the path to the destination where the file should be saved.

1.png

  • Then it will ask some question to get information for the certificate.

2

3

4

5

6

7

8

9

  • After giving all these information it will show a dialog like this. Where you can type ‘yes‘ and proceed with the given information or type ‘no‘ and change them.

10.png

  • Then again it will ask for another password for <tomcat>. If you use the same as previous just hit enter.

11

  • Now you have successfully created a key for you. Then there is another small thing to do to enable ssl. That is you have do some modification in the tomcat configuration file. You can find the tomcat configuration file,

$CATALINA_HOME/conf/server.xml

12

  • When you scroll through the server.xml file, you will find some commands like this. There are commented.

13.png

  • Just uncomment them to enable ssl.

14

  • Now you can check it by browsing following url on the browser,

https://localhost:8443/

  • Here the port used by the tomcat is 8443.

Hope you got a clear idea about what is ssl and how to enable ssl on your tomcat server. See you soon with another interesting topic. Thank You!

Advertisements

2 thoughts on “SSL IN TOMCAT

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s