Skip to content

Instantly share code, notes, and snippets.

Created September 23, 2019 20:18
What would you like to do?
Create self-signed certificate
#!/usr/bin/env bash
openssl req -newkey rsa:2048 -days 3650 -x509 -nodes -keyout server.key -new -out server.crt -config ./openssl-cert.cnf -sha256
default_bits = 2048
prompt = no
default_md = sha256
x509_extensions = v3_req
distinguished_name = dn
C = BE
ST = Antwerp
L = Antwerp
O = IT
OU = IT Department
emailAddress =
CN = localhost
subjectAltName = @alt_names
DNS.1 = *.localhost
DNS.2 = localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment