Skip to content

Instantly share code, notes, and snippets.

@bradmontgomery
Last active March 27, 2019 18:04
Show Gist options
  • Save bradmontgomery/6479492 to your computer and use it in GitHub Desktop.
Save bradmontgomery/6479492 to your computer and use it in GitHub Desktop.
Setting up a StartSSL cert for nginx. Adapted From: http://www.startssl.com/?app=42

How to set up an SSL cert from StartSSL

  1. create a private key and certificate and transfer them to your server (do this at startssl.com).

  2. Decrypt the private key by using the password you entered when you created your key:

    openssl rsa -in ssl.key -out /etc/nginx/conf/ssl.key
    
  3. Protect your key from prying eyes:

    chmod 600 /etc/nginx/conf/ssl.key
    
  4. Fetch the Root CA and Class 1 Intermediate Server CA certificates:

    wget http://www.startssl.com/certs/ca.pem
    wget http://www.startssl.com/certs/sub.class1.server.ca.pem
    
  5. Create a unified certificate from your certificate and the CA certificates:

    cat ssl.crt sub.class1.server.ca.pem ca.pem > /etc/nginx/conf/ssl-unified.crt
    
  6. Configure your nginx server to use the new key and certificate (in the global settings or a server section):

    ssl on;
    ssl_certificate /etc/nginx/conf/ssl-unified.crt;
    ssl_certificate_key /etc/nginx/conf/ssl.key;
    
  7. Tell nginx to reload its configuration:

    killall -HUP nginx
    
  8. And you’re done!

@Jay54520
Copy link

http://www.startssl.com/certs/sub.class1.server.ca.pem is sub.class1.server.ca.pem? Is this right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment