Skip to content

Instantly share code, notes, and snippets.

@obfusk
Last active December 26, 2015 01:49
Show Gist options
  • Select an option

  • Save obfusk/7074059 to your computer and use it in GitHub Desktop.

Select an option

Save obfusk/7074059 to your computer and use it in GitHub Desktop.
ssl

Generate

$ openssl req -x509 -newkey rsa:2048 -keyout foo.key \
  -out foo.crt -days 3600 -nodes -config conf

View

$ openssl x509 -noout -text -in foo.pem

Nginx

ssl_certificate     /etc/felix/ssl/foo.crt;
ssl_certificate_key /etc/felix/ssl/foo.key;

App

listen 443 ssl;
proxy_set_header X-Forwarded-Proto $scheme;
[req]
prompt = no
distinguished_name = req_distinguished_name
req_extensions = v3_req
x509_extensions = v3_req
[req_distinguished_name]
C = COUNTRY_CODE
ST = STATE
L = CITY
O = COMPANY (YOU)
OU = IT
CN = *.foo.example.com
emailAddress = [email protected]
[v3_req]
subjectAltName = DNS:*.foo.example.com,DNS:*.bar.example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment