SSL tomcat configuration

Posted on 2006-05-10
Last Modified: 2008-10-27
Hi Experts! Please help out Project deadline approaching

To configure SSL on tomcat, i am done the following(as shown on
1.)I create a new keystore from scratch, containing a single self-signed Certificate, execute the following from a terminal command line:
2.) I am using jdk5 so no need to download jsse.

3.) my ".storekey" looks as follow:
<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"
               keystoreFile="C:\Documents and Settings\myName\.keystore"

MY PROBLEM: I am getting the exception below:

SEVERE: Error initializing endpoint Cannot recover key
      at org.apache.coyote.http11.Http11Protocol.init(
      at org.apache.coyote.tomcat5.CoyoteConnector.initialize(
      at org.apache.catalina.core.StandardService.initialize(
      at org.apache.catalina.core.StandardServer.initialize(
      at org.apache.catalina.startup.Catalina.load(
      at org.apache.catalina.startup.Catalina.load(
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      at java.lang.reflect.Method.invoke(
      at org.apache.catalina.startup.Bootstrap.load(
      at org.apache.catalina.startup.Bootstrap.main(
May 10, 2006 4:13:06 PM org.apache.catalina.startup.Catalina load
SEVERE: Catalina.start
LifecycleException:  Protocol handler initialization failed: Cannot recover key
      at org.apache.coyote.tomcat5.CoyoteConnector.initialize(
Question by:komlaaa
    LVL 19

    Accepted Solution

    This has to do with the password used for the SSL private key.There is a restriction in the Tomcat server that the password forthe SSL key must be identical to the password for the keystore.(This restriction is currently not mentioned in the Installationand Configuration Guide.)

    You can fix this by changing the password of your SSL key using the 'keytool' command line tool. At the command prompt change to the keystore directory (by default this is the Ponton X/P installationdirectory) and type the following:

    keytool -keypasswd -alias tomcat -keystore ssl-keystore

    The key to will ask you for the old password and then the new password. Change the key password to the default password 'changeit' - that should solve the problem.

    Note: 'changeit' is the default password for the SSL keystore. If you decide to use a different keystore password, please note that you will need to specify this in the Tomcat configuration file server.xml.

    LVL 19

    Expert Comment

    Actually, you need to issue:

    keytool -keypasswd -alias tomcat

    then change the key password to "changeit" which is identical to the password for the keystore.

    I assumed that you gave password of keystore as "changeit" as you specified in the server.xml.

    It should do it.

    Ok. Enjoy and be relaxed :)


    Author Comment

    you are right actonwang. my bad, i did not provide the same password twice during the account setup process.

    Your are good

    thanks again

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    When we have a dead host and we lose all connections to the ESXi, and we need to find a way to move all VMs from that dead ESXi host.
    There are many benefits to finding online courses that align with your personal or career goals. Read more about our reasons for continuing your education in technology.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now