-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmk_cert.sh
executable file
·44 lines (40 loc) · 945 Bytes
/
mk_cert.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
install_dir=$(which flowsim)
if [ -z "$install_dir" ]; then
echo "Install flowsim FIRST"
exit
fi
cd $(dirname $install_dir)
openssl req \
-newkey rsa:2048 \
-nodes \
-days 3650 \
-x509 \
-keyout flowsimCA.key \
-out flowsimCA.crt \
-subj "/CN=*"
openssl req \
-newkey rsa:2048 \
-nodes \
-keyout flowsim-server.key \
-out flowsim-server.csr \
-subj "/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=*"
openssl x509 \
-req \
-days 365 \
-sha256 \
-in flowsim-server.csr \
-CA flowsimCA.crt \
-CAkey flowsimCA.key \
-CAcreateserial \
-out flowsim-server.crt \
-extfile <(echo subjectAltName = IP:127.0.0.1)
openssl req \
-x509 \
-nodes \
-newkey rsa:2048 \
-keyout flowsim-client.key \
-out flowsim-client.crt \
-days 3650 \
-subj "/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=*"
cd -