Wednesday, September 19, 2012

SSL for tomcat 7

Let's configure ssl for tomcat 7.0.29 and ubuntu

remember to delete any old ~/.keystore file u have generated before, because this could cause an issue.

> keytool -genkey -alias tomcat -keyalg RSA -validity 365

Enter keystore password:  "changeit"
Re-enter new password: "changeit"
What is your first and last name?
  [Unknown]:  $REPLACE_WITH_FULL_MACHINE_NAME
What is the name of your organizational unit?
  [Unknown]:  Test
What is the name of your organization?
  [Unknown]:  Test
What is the name of your City or Locality?
  [Unknown]:  Test
What is the name of your State or Province?
  [Unknown]:  Test
What is the two-letter country code for this unit?
  [Unknown]:  US
Is CN=$FULL_MACHINE_NAME, OU=Test, O=Test, L=Test, ST=Test, C=US correct?
  [no]:  yes
asdf

and uncomment the section with ssl connection from server.xml and restart your tomcat you're good to go.