Strictly Programming

Generating SSL for Apache and Tomcat

Posted in Apache by sqllyw on 07/18/2011

Generate a self signed ssl certificate for Apache and Tomcat.
This is a quick node to generate a self signed ssl certificate for Apache and Tomcat, please refer to
following two links for more info:

How to create a self-signed SSL Certificate

Jetty ssl setup

For Apache:

1.Generate a Private Key

openssl genrsa -des3 -out server.key 1024

2.Generate a CSR (Certificate Signing Request)
openssl req -new -key server.key -out server.csr
note: in common name, enter http://www.sample.com

3. Remove passphrase

cp server.key server.key.org
openssl rsa -in server.key.org -out server.key

4. self signed
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

server.key and server.crt can be installed now in apache

For tomcat, generate a jks key for use:

openssl pkcs12 -inkey server.key -in server.crt -export -out server.pkcs12

java -classpath /Users/u/jetty-6.1.26/lib/jetty-util-6.1.26.jar:/Users/u/jetty-6.1.26/lib/jetty-6.1.26.jar org.mortbay.jetty.security.PKCS12Import server.pkcs12 server.jks

server.jks can be used in tomcat’s server.xml

how to hookup nginx with startssl
StartSSL and Nginx

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: