File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
sdn_tests/pins_ondatra/infrastructure/certs Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ package (
2+ default_visibility = ["//visibility:public" ],
3+ licenses = ["notice" ],
4+ )
5+
6+ filegroup (
7+ name = "certs" ,
8+ srcs = glob (["*.pem" ]),
9+ )
Original file line number Diff line number Diff line change 1+ rm ca_key.pem ca_crt.pem server_key.pem server_req.pem server_crt.pem server_ext.cnf client_key.pem client_req.pem client_crt.pem client_ext.cnf
2+
3+ echo subjectAltName = IP:" $1 " > server_ext.cnf
4+ # 1. Generate CA's private key and self-signed certificate
5+ openssl req -x509 -newkey rsa:4096 -days 365 -nodes -keyout ca_key.pem -out ca_crt.pem -subj " /C=US"
6+
7+ # 2. Generate web server's private key and certificate signing request (CSR)
8+ openssl req -newkey rsa:4096 -nodes -keyout server_key.pem -out server_req.pem -subj " /CN='$1 '"
9+
10+ # 3. Use CA's private key to sign web server's CSR and get back the signed certificate
11+ openssl x509 -req -in server_req.pem -days 100 -CA ca_crt.pem -CAkey ca_key.pem -CAcreateserial -out server_crt.pem -extfile server_ext.cnf
12+
13+ echo subjectAltName = IP:" $1 " > client_ext.cnf
14+ # 4. Generate client's private key and certificate signing request (CSR)
15+ openssl req -newkey rsa:4096 -nodes -keyout client_key.pem -out client_req.pem -subj " /CN=*"
16+
17+ # 5. Use CA's private key to sign client's CSR and get back the signed certificate
18+ openssl x509 -req -in client_req.pem -days 100 -CA ca_crt.pem -CAkey ca_key.pem -CAcreateserial -out client_crt.pem -extfile client_ext.cnf
You can’t perform that action at this time.
0 commit comments