Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vishwassharma/7ec1b90b59bf23ef3143ec48b9641a2c to your computer and use it in GitHub Desktop.
Save vishwassharma/7ec1b90b59bf23ef3143ec48b9641a2c to your computer and use it in GitHub Desktop.
#Generate a certificate authority certificate and key.
openssl req -new -x509 -days <duration> -extensions v3_ca -keyout ca.key -out ca.crt
#Server
- Generate a server key.
openssl genrsa -des3 -out server.key 2048
- Generate a server key without encryption.
openssl genrsa -out server.key 2048
- Generate a certificate signing request to send to the CA.
openssl req -out server.csr -key server.key -new
- Send the CSR to the CA, or sign it with your CA key:
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days <duration>
#Client
- Generate a client key.
openssl genrsa -des3 -out client.key 2048
- Generate a certificate signing request to send to the CA.
openssl req -out client.csr -key client.key -new
- Send the CSR to the CA, or sign it with your CA key:
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days <duration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment