From 0ef7952a8980ed67180410b66c7017b3e9d5c264 Mon Sep 17 00:00:00 2001 From: finlab Date: Sun, 17 Jan 2021 05:41:13 +0800 Subject: [PATCH] add openssl --- openssl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 openssl diff --git a/openssl b/openssl new file mode 100644 index 0000000..16a1b8e --- /dev/null +++ b/openssl @@ -0,0 +1,10 @@ +openssl genrsa -out ca.key 2048 +openssl req -new -x509 -days 365 -key ca.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" -out ca.crt + +openssl req -newkey rsa:2048 -nodes -keyout server.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=*.example.com" -out server.csr +openssl x509 -req -extfile <(printf "subjectAltName=DNS:example.com,DNS:www.example.com,IP:0.0.0.0") -days 365 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt + +openssl req -newkey rsa:2048 -nodes -keyout client.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=*.example.com" -out client.csr +openssl x509 -req -extfile <(printf "subjectAltName=DNS:example.com,DNS:www.example.com,IP:0.0.0.0") -days 365 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt + +openssl x509 -in server.crt -text -noout \ No newline at end of file