Skip to content

Instantly share code, notes, and snippets.

@thomheymann
Forked from jessedearing/gist:2351836
Created July 23, 2014 19:27
Show Gist options
  • Save thomheymann/e480a7e213c2cb32f154 to your computer and use it in GitHub Desktop.
Save thomheymann/e480a7e213c2cb32f154 to your computer and use it in GitHub Desktop.

Revisions

  1. @twoism-dev twoism-dev created this gist Aug 31, 2011.
    22 changes: 22 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/bin/bash
    echo "Generating an SSL private key to sign your certificate..."
    openssl genrsa -des3 -out myssl.key 1024

    echo "Generating a Certificate Signing Request..."
    openssl req -new -key myssl.key -out myssl.csr

    echo "Removing passphrase from key (for nginx)..."
    cp myssl.key myssl.key.org
    openssl rsa -in myssl.key.org -out myssl.key
    rm myssl.key.org

    echo "Generating certificate..."
    openssl x509 -req -days 365 -in myssl.csr -signkey myssl.key -out myssl.crt

    echo "Copying certificate (myssl.crt) to /etc/ssl/certs/"
    mkdir -p /etc/ssl/certs
    cp myssl.crt /etc/ssl/certs/

    echo "Copying key (myssl.key) to /etc/ssl/private/"
    mkdir -p /etc/ssl/private
    cp myssl.key /etc/ssl/private/