Skip to content

Instantly share code, notes, and snippets.

@msioen
Created September 23, 2019 20:18
Show Gist options
  • Save msioen/4f440ec49eec3254941ce3e4c6ff7982 to your computer and use it in GitHub Desktop.
Save msioen/4f440ec49eec3254941ce3e4c6ff7982 to your computer and use it in GitHub Desktop.
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
[req]
default_bits = 2048
prompt = no
default_md = sha256
x509_extensions = v3_req
distinguished_name = dn
[dn]
C = BE
ST = Antwerp
L = Antwerp
O = IT
OU = IT Department
emailAddress = it@example.com
CN = localhost
[v3_req]
subjectAltName = @alt_names
[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