Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lucamilan/405be731721178feef715c36fc221751 to your computer and use it in GitHub Desktop.
Save lucamilan/405be731721178feef715c36fc221751 to your computer and use it in GitHub Desktop.
OpenSSL
// create CA key
openssl genrsa -out ca.key 2048
// create CA cert
openssl req -x509 -sha256 -new -nodes -key ca.key -days 365 -out ca.pem
// create client key
openssl genrsa -out client.key 2048
// create client csr
openssl req -new -key client.key -out client.csr
// create openssl extension file and fill in DNS entry for client
subjectAltName = @alt_names
[alt_names]
DNS.1 = client
IP.1 = 127.0.0.1
// create client cert
openssl x509 -req -in client.csr -CA ca.pem -CAkey ca.key -CAcreateserial -out client.pem -days 365 -sha256 -extfile client.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment