Jul 242008
 

Generate the keys for the Certificate Authority (the key that will do the signing)
Code:

$ openssl genrsa -des3 -out ca.key 4096
$ openssl req -new -x509 -days 3650 -key ca.key -out ca.crt

Generate the private key for your server

Code:

$ openssl genrsa -des3 -out server.key 4096

Create a CSR (certificate signing request) to get signed by the CA

Code:

$ openssl req -new -key server.key -out server.csr

Sign your csr with the key you made in the first step

Code:

$ openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt

Optionally remove the password from your key (if you do this protect your key!!!)

Code:

$ openssl rsa -in server.key -out server.key.nopass

Add these lines to your Apache config

Code:

SSLEngine on
SSLCertificateFile    /www/ssl.crt/server.crt
SSLCertificateKeyFile /www/ssl.key/server.key

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.