Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Themitchell/54c9c050d9ed8f6f5bf695388a1a57a5 to your computer and use it in GitHub Desktop.
Save Themitchell/54c9c050d9ed8f6f5bf695388a1a57a5 to your computer and use it in GitHub Desktop.
Creating Self Signed Certificates

Creating Self Signed Certificates for use with Node and Chrome

Creating the certificate files

  1. Generate a private key with open ssl.

    $ openssl genrsa -des3 -out /var/lib/ssl/self-signed.key 1024
  2. Generate a CSR (Certificate Signing Request).

    $ openssl req -new -key /var/lib/ssl/self-signed.key -out /var/lib/ssl/self-signed.csr
  3. 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
  4. 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

Add your certificate as trusted to chrome

  1. Open keychain access
  2. Drag and drop the .crt file from /var/lib/ssl into your system certificates.
  3. Enjoy https in development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment