Creating self signed SSL certificates for development testing by Shaine Gordon | 21 February 2011 | 0 Comments

Sometimes it is necessary to have access to SSL certificates in a development environment without having access to the actual certificates which are certified to be used on a specific production domain.

This is how to create certificates for use on a server "localhost":

Requirements

  • OpenSSL (This is available as part of the binary distribution of Apache httpd 2.2)

Creating files

1.    Generate a CSR: 

  •  - openssl req -config [path/to/openssl.conf] -new -out -server.csr -keyout -server.pem

  •  - This will present you with some values to supply. The only required value is "Common Name", which will be what your servername is, in this case "localhost"

2.    Create the key:

  •  - openssl rsa -in server.pem -out server.key

3.    Create the certificate

 - openssl x509 -in server.csr -out server.cert -req -signkey server.key -days 365

These files can now be used, for example, in Apache httpd and mod_ssl

Have your sayLeave your comments underneath: