AspBucket offers ASP.NET, C#, VB, Jquery, CSS, Ajax, SQL tutorials. It is the best place for programmers to learn

Tuesday 6 September 2022

How to setup Tomcat to support SSL or https?



This article we will setup https on tomcat. 

Prerequisite :

1)JDK installed + JAVA_HOME environment variable setup

2) Tomcat 8.0 archieve file

Now open cmd :

  run this command:

  cd %JAVA_HOME%/bin


Step 1: Generating keystore file : .keystore

keytool -genkey -alias tomcat -keyalg RSA

and save entered password : password1

keystore file will be generated inside the following location :C:/Users/Your UserName/ .keystore


Step 2: Now we will configure tomcat for using keystore file and -SSL config.

now open server.xml file  and replace following :

<Connector SSLEnabled="true" acceptCount="100" clientAuth="false"
    disableUploadTimeout="true" enableLookups="false" maxThreads="25"
    port="8443" keystoreFile="C:/Users/Administrator/.keystore" keystorePass="password1"
    protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https"
    secure="true" sslProtocol="TLS" />


Launch the Apache tomcat and access https://localhost:8443.

You will be able to browse the application in https.

0 comments :

Post a Comment

  • Popular Posts
  • Comments