Creating your own SSL certificates

If you need a SSL certificate, it is quite easy to create them with OpenSSL. Of course, every browser will issue a warning for self-signed certificates.

Create a private key:
openssl genrsa -aes128 -out privkey.pem 2048

Create a certificate request:
openssl req -new -key privkey.pem -out cert.csr

Create a self-signed certificate (valid for 10 years):
openssl req -new -x509 -key privkey.pem -out cacert.pem -days 3652

Decrypt a private key (to be able to (re)start the webserver without requiring a certificate password):
openssl rsa -in privkey.pem -out privkey.pem