Wednesday, August 29, 2012

Tomcat Configuration Https without port number

Install tomcat or Unzip tomcat and run the start.bat file from APACHE_HOME\bin.
Tomcat runs on http with 8080 port default.
To test, type http://localhost:8080 in browser.

To enable HTTPS

We need to change few configuration in the APACHE_HOME \conf\server.xml file.

Uncomment the connector in APACHE_HOME \conf\server.xml file.

Create an abc.jks file using keytool and place in the ${user.home}.
Note: ${user.home} in windows “C:\Documents and Settings\user”.
Now we can access https with the following set up.
To test, type https://localhost:8443 in browser.

Remove 8443 port

Default security port is 443.
So, change the port from 8443 to 443 in the above connector as follows.

To test, type https://localhost in browser.

6 comments :

  1. i have tried all the steps it didn't work

    ReplyDelete
    Replies
    1. Check Creation of jks, use the created jks and re-test.

      Check http://vardhan-justlikethat.blogspot.in/2011/09/spring-security-namespace-configuration.html

      Delete
  2. for enable https
    i'm getting error as

    SSL connection error
    Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.

    ReplyDelete
    Replies
    1. If your SSL certificate is correct, you can achieve it easily. Your SSL Certificate or jks in the keytool is wrong.

      Please create our own jks file, using keytool Or If your using client certificate, import the certificate into your keystore and re-try again.

      Code posted is taken from the sample application which I have developed. Try and Best of luck

      Delete
    2. i have created the jks file with the help of this link

      http://www.sslshopper.com/article-how-to-create-a-self-signed-certificate-using-java-keytool.html

      it was created successfully after that also im getting

      SSL connection error
      Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.

      Delete
  3. finally i got solution from this link http://www.mkyong.com/tomcat/how-to-configure-tomcat-to-support-ssl-or-https/

    thanQ!!!! Vardhan

    ReplyDelete