JBoss jBPM review Hacking Wordpress Mu code
Dec 10

This post explains step by step actions to enable SSL in Tomcat

  1. Generate an RSA key for signing the certificate:
    openssl genrsa -out key.pem 2048
  2. Generate a certificate using the new key:
    openssl req -new -x509 -key key.pem -out cert.pem -days 365

    Answer the quesstions with your name, organization name, e-mail, etc.

  3. Since the certificate is in PEM format, convert it to PKCS12 for Tomcat:
    openssl pkcs12 -export -in cert.pem -inkey key.pem -out cert.p12 -name tomcat

    Enter a password, don’t leave it blank.

  4. Edit $TOMCAT_HOME/conf/server.xml and modify the SSL connector:
        <Connector port="8443"
             maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
             enableLookups="false" disableUploadTimeout="true"
             acceptCount="100" debug="0" scheme="https" secure="true"
             clientAuth="false" sslProtocol="TLS" keystoreType="PKCS12"
             keystoreFile="conf/cert.p12" keystorePass="password"/>

    Remember to change password with the one typed at 3.

Note: DON’T use a self-signed certificate in a PRODUCTION SITE! Contact with a CA to sign your certificate.

Related Posts

7 Responses to “Configuring Tomcat 5.5 for SSL using OpenSSL”

  1. Ruben Espadas Says:

    Great post, can you publish a part II? where you will explain the clientAtuh. please….

  2. syed Says:

    It shows page cannot be displayed as i followed your step

  3. amit bohra Says:

    this tutorial is bogus, it aint gonna work!

  4. pigui Says:

    @amit bohra
    It may be obsolete (I don’t know…) but it really works with Tomcat 5.5.

    Can you instruct us?

  5. amit bohra Says:

    step 4 – you need to specify the following things to tomcat / server.xml

    1. private key file
    2. copy root CA certificate to the conf directory

    otherwise if you try to access tomcat with https://sitename.com it will show a 404 error!

  6. amit bohra Says:

    visit this page for more information guys –

    http://thilinag.blogspot.com/2008/02/setting-up-https-in-apache-tomcat-using.html

  7. pigui Says:

    @amit bohra

    Totally agree with you. I forgot about writing these steps, I’ll update the post with you observations as soon as I have five mins.

    I’m sorry if I was rude in my first comment.

    Thanks for your comments .

Leave a Reply