Skip to content

Instantly share code, notes, and snippets.

@ryzy
Last active March 12, 2016 23:40
Show Gist options
  • Save ryzy/46f250ba9586b8a46a88 to your computer and use it in GitHub Desktop.
Save ryzy/46f250ba9586b8a46a88 to your computer and use it in GitHub Desktop.
SSL dummy cert for Nginx and HAProxy
# Generate all keys and cefiticates in /etc/ssl/ directory
openssl genrsa -out /etc/ssl/dummy.key 2048
openssl req -new -key /etc/ssl/dummy.key -out /etc/ssl/dummy.csr -subj "/C=GB/L=London/O=Company Ltd/CN=haproxy"
openssl x509 -req -days 3650 -in /etc/ssl/dummy.csr -signkey /etc/ssl/dummy.key -out /etc/ssl/dummy.crt
# Concatenate certificate and key into .pem format, compatible with HAProxy
cat /etc/ssl/dummy.crt /etc/ssl/dummy.key > /etc/ssl/dummy.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment