Created
February 25, 2016 01:14
-
-
Save adamanthil/93c59d97ba04476dbcc5 to your computer and use it in GitHub Desktop.
Series of shell commands to create a self-signed SSL cert for use in a dev environment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create self signed cert | |
# Reference: http://www.akadia.com/services/ssh_test_certificate.html | |
# Create key (will prompt for a passphrase. This password will be removed later for convenience) | |
openssl genrsa -des3 -out server.key 2048 | |
# Generate CSR | |
openssl req -new -key server.key -out server.csr | |
# Remove key passphrase | |
cp server.key server.key.org | |
openssl rsa -in server.key.org -out server.key | |
# Generate self-signed certificate (valid for 10 years) | |
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt | |
# If a chain file is needed, the original cert can be used as the chain in this case. | |
# Copy certificate to use as chain file | |
cp server.crt bundle.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment