Skip to content

Instantly share code, notes, and snippets.

@darconeous
Last active August 9, 2023 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darconeous/92f12a9f14db30a5986d675fce63efba to your computer and use it in GitHub Desktop.
Save darconeous/92f12a9f14db30a5986d675fce63efba to your computer and use it in GitHub Desktop.
OpenSSL self-signed certificate config
# Use like:
#
# ```
# openssl req -x509 -nodes \
# -days 3650 \
# -newkey rsa:2048 \
# -keyout /etc/ssl/private/host.key.pem \
# -out /etc/ssl/certs/host.crt.pem \
# -config self-signed-cert.cfg
# ```
[ req ]
x509_extensions = v3_ca
prompt = no
distinguished_name = req_distinguished_name
[ req_distinguished_name ]
commonName = Example Reverse Proxy
[ alternate_names ]
DNS.1 = example.com
DNS.2 = *.example.com
[ v3_ca ]
nsCertType = server
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = CA:false
keyUsage = critical, digitalSignature, keyAgreement
extendedKeyUsage = serverAuth
nsComment = "OpenSSL Generated Server Certificate"
subjectAltName = @alternate_names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment