File tree Expand file tree Collapse file tree 3 files changed +40
-65
lines changed Expand file tree Collapse file tree 3 files changed +40
-65
lines changed Original file line number Diff line number Diff line change
1
+ [req]
2
+ default_bits = 4096
3
+ prompt = no
4
+ default_md = sha256
5
+ req_extensions = req_ext
6
+ distinguished_name = dn
7
+
8
+ [dn]
9
+ C = CZ
10
+ ST = Central Bohemia
11
+ L = Prague
12
+ O = CA
13
+ OU = IT
14
+ CN = localhost
15
+ emailAddress = foo@example.net
16
+
17
+ [req_ext]
18
+ subjectAltName = @alt_names
19
+
20
+ [alt_names]
21
+ DNS.1 = localhost
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # Generate self signed root CA cert
4
+ openssl req -days 365 -config my.conf -nodes -x509 -newkey rsa:4096 -keyout ca.key -out ca-crt.pem -subj " /C=CZ/ST=Central Bohemia/L=Prague/O=CA/OU=IT/CN=localhost/emailAddress=foo@example.net"
5
+
6
+ # Generate server cert to be signed
7
+ openssl req -nodes -newkey rsa:4096 -keyout server-key.pem -out server.csr -subj " /C=CZ/ST=Central Bohemia/L=Prague/O=foo/OU=IT/CN=localhost/emailAddress=foo@example.net"
8
+
9
+ # Sign the server cert
10
+ openssl x509 -req -days 365 -in server.csr -CA ca-crt.pem -CAkey ca.key -CAcreateserial -out server-crt.pem -extensions req_ext -extfile my.conf
11
+
12
+ # Clean up extra files
13
+ rm ca-crt.srl ca.key server.csr
14
+
15
+ # Verify certs validate correctly
16
+ echo " -----"
17
+ echo " Verifying certs"
18
+ openssl verify -CAfile ca-crt.pem ca-crt.pem
19
+ openssl verify -CAfile ca-crt.pem server-crt.pem
You can’t perform that action at this time.
0 commit comments