Created
September 13, 2012 21:21
-
-
Save cosine/3717769 to your computer and use it in GitHub Desktop.
How to make a self-signed certificate quickly.
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
# Change key values below for your certificate. | |
# Quickly create self-signed server cert. | |
(umask 077 && openssl genrsa -out config/cert.key 2048) | |
openssl req -new -key cert.key -out cert.crt -x509 -days 7305 -set_serial 01 -config /dev/fd/3 -extensions cert_server 3<<__EOF__ | |
[ req ] | |
distinguished_name = req_dn | |
prompt = no | |
[ req_dn ] | |
C = US | |
ST = Illinois | |
L = Chicago | |
O = Big Mega Corp | |
OU = Security Development | |
CN = www.example.com | |
emailAddress = webmaster@example.com | |
[ cert_server ] | |
basicConstraints = CA:FALSE | |
keyUsage = digitalSignature, keyEncipherment, keyAgreement | |
extendedKeyUsage = serverAuth | |
nsCertType = server | |
nsComment = "Self-Signed Web Server Certificate" | |
subjectKeyIdentifier = hash | |
authorityKeyIdentifier = keyid,issuer:always | |
subjectAltName = email:copy | |
issuerAltName = issuer:copy | |
__EOF__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment