Thursday, September 10, 2015

Creating a self-signed SSL certificate

To generate a self-signed certificate, run the following commands in your shell:

openssl genrsa -out key.pem

openssl req -new -key key.pem -out csr.pem

openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem

rm csr.pem


This should leave you with two files, cert.pem (the certificate) and key.pem (the private key). This is all you need for a SSL connection.

2 comments: