ssltomcat

Import and use already existing SSL certificates with new Tomcat instance


I had to completely to re-install Tomcat server using new hardware but I have certificates from Certificate Authority which was used in previous installation:

Is it possible to use those cetificates again or shall I buy new? If I can use the cetificates again please guide me how to import them because as I understood it must be coupled with private key from new installation.

Thank you!


Solution

  • I am assuming that the old Tomcat server has a still readable disk or a backup exists. If you don't and don't have a copy of the private key and certificate then you will have to buy a new cert.

    You can copy the private key and certificate from the old Tomcat server to the new one.

    On the old machine open the file %TOMCAT_HOME%/conf/server.xml and find the Connector definition where the SSLEnabled="true". There you will find paths to the files containing key and certificates.

    Copy these files to the new machine and edit its server.xml to point at the copied files.

    That's it.