Last active
January 15, 2023 18:25
-
-
Save aphu/a3858470ee4d3e76d5f939de281cf848 to your computer and use it in GitHub Desktop.
OpenSSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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