Skip to content

Instantly share code, notes, and snippets.

@paulreece42
Created July 20, 2017 19:54
Show Gist options
  • Save paulreece42/8b36c33230ad02c82436c99fcc174f72 to your computer and use it in GitHub Desktop.
Save paulreece42/8b36c33230ad02c82436c99fcc174f72 to your computer and use it in GitHub Desktop.
SAN Certificate self-signed by own CA, good (in theory, but untested) for k8s etc
## BEGIN san.cnf ##
[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[ req_distinguished_name ]
commonName = foo.bar
[ v3_req ]
subjectAltName = @alt_names
[alt_names]
DNS.1 = bar.baz
IP.1 = 127.0.0.1
## END san.cnf ##
openssl req -out sslcert.csr -newkey rsa:2048 -nodes -keyout private.key -config san.cnf
openssl x509 -in sslcert.csr -out sslcert.crt -req -signkey /path/to/my/ca.key -days 3650 -extfile san.cnf -extensions v3_req
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment