Get identity when using TLS certificates

Signed-off-by: Nicol Draghici <idraghic@cisco.com>
This commit is contained in:
Nicol Draghici
2022-08-12 15:18:41 +03:00
committed by Andrei Aaron
parent f9f388f32e
commit 5450139ba1
4 changed files with 208 additions and 9 deletions
+45
View File
@@ -0,0 +1,45 @@
#!/bin/bash -xe
openssl req \
-newkey rsa:2048 \
-nodes \
-days 3650 \
-x509 \
-keyout ca.key \
-out ca.crt \
-subj "/CN="
openssl req \
-newkey rsa:2048 \
-nodes \
-keyout server.key \
-out server.csr \
-subj "/OU=TestServer/CN="
openssl x509 \
-req \
-days 3650 \
-sha256 \
-in server.csr \
-CA ca.crt \
-CAkey ca.key \
-CAcreateserial \
-out server.cert \
-extfile <(echo subjectAltName = IP:127.0.0.1)
openssl req \
-newkey rsa:2048 \
-nodes \
-keyout client.key \
-out client.csr \
-subj "/OU=TestClient/CN="
openssl x509 \
-req \
-days 3650 \
-sha256 \
-in client.csr \
-CA ca.crt \
-CAkey ca.key \
-CAcreateserial \
-out client.cert