openssl genrsa 2048 > ca-key.pem
openssl req -new -x509 -nodes -days 365000 \
-key ca-key.pem \
-out ca-cert.pem \
-subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=example.com"
openssl req -newkey rsa:2048 -nodes -days 365000 \
-keyout server-key.pem \
-out server-req.pem \
-subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost"
openssl x509 -req -days 365000 -set_serial 01 \
-in server-req.pem \
-out server-cert.pem \
-CA ca-cert.pem \
-CAkey ca-key.pem
openssl req -newkey rsa:2048 -nodes -days 365000 \
-keyout client-key.pem \
-out client-req.pem \
-subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=client.example.com"
openssl x509 -req -days 365000 -set_serial 01 \
-in client-req.pem \
-out client-cert.pem \
-CA ca-cert.pem \
-CAkey ca-key.pem
openssl verify -CAfile ca-cert.pem \
ca-cert.pem \
server-cert.pem
openssl verify -CAfile ca-cert.pem \
ca-cert.pem \
client-cert.pem
curl --request GET \
--url https://localhost:8080/ \
--cert client-cert.pem \
--key client-key.pem \
--cacert ca-cert.pem