Skip to content

Instantly share code, notes, and snippets.

@jshen28
Last active November 5, 2018 00:32
Show Gist options
  • Select an option

  • Save jshen28/d7ff3e8f1d0827a3812fd04d3cdac0f7 to your computer and use it in GitHub Desktop.

Select an option

Save jshen28/d7ff3e8f1d0827a3812fd04d3cdac0f7 to your computer and use it in GitHub Desktop.
# generate ca key & certificate
openssl genrsa -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -sha256 -days 10000 -out ca.crt

# generate client key & csr
openssl genrsa -out client.key 2048
openssl req -new -key client.key -out client.csr

# sign request and get client certificate
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days 1024 -sha256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment