-
Generate a private key with open ssl.
$ openssl genrsa -des3 -out /var/lib/ssl/self-signed.key 1024
-
Generate a CSR (Certificate Signing Request).
$ openssl req -new -key /var/lib/ssl/self-signed.key -out /var/lib/ssl/self-signed.csr
-
Remove the passphrase from the key (other wise we have to enter it everytime we satrt the server).
$ cp ~/.ssl/self-signed.key ~/.ssl/self-signed.key.org $ openssl rsa -in /var/lib/ssl/self-signed.key.org -out /var/lib/ssl/self-signed.key
-
Generate your Self signed certificate (This certificate will be good for 1 year).
$ openssl x509 -req -days 365 -in/var/lib/ssl/self-signed.csr -signkey /var/lib/ssl/self-signed.key -out /var/lib/ssl/self-signed.crt
- Open keychain access
- Drag and drop the
.crt
file from/var/lib/ssl
into yoursystem
certificates. - Enjoy https in development