Skip to content

Instantly share code, notes, and snippets.

@corehello
Last active August 29, 2015 14:12
Show Gist options
  • Save corehello/0a65f0e0a151f02ab08d to your computer and use it in GitHub Desktop.
Save corehello/0a65f0e0a151f02ab08d to your computer and use it in GitHub Desktop.
Generate certificate with openssl
#generate CA self-signed certificate
openssl genrsa -out private\ca.key -rand private\.rnd -des 2048
openssl req -new -x509 -days 3650 -key private\ca.key -out private\ca.crt -config openssl.cnf
openssl x509 -in private\ca.crt -noout -text
#generate server certificate
openssl genrsa -out private\server.key 1024
openssl req -new -key private\server.key -out newcerts\server.csr -config openssl.cnf
openssl ca -in newcerts\server.csr -cert private\ca.crt -keyfile private\ca.key
-config openssl.cnf -policy policy_anything -out certs\server.crt
openssl x509 -in certs\server.crt -noout -text
#generate proxy certificate
openssl genrsa -out private\proxy.key 1024
openssl req -new -key private\proxy.key -out newcerts\proxy.csr -config openssl.cnf
openssl ca -in newcerts\proxy.csr -cert private\ca.crt -keyfile private\ca.key -config openssl.cnf -policy policy_anything -out certs\proxy.crt
openssl x509 -in certs\proxy.crt -noout -text
#generate client certificate
openssl genrsa -out private\client.key 1024
openssl req -new -key private\client.key -out newcerts\client.csr -config openssl.cnf
openssl ca -in newcerts\client.csr -cert private\ca.crt -keyfile private\ca.key -config openssl.cnf -policy policy_anything -out certs\client.crt
openssl x509 -in certs\client.crt -noout -text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment