-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_cert
68 lines (37 loc) · 1.37 KB
/
create_cert
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
openssl req -new -config ssl.cfn -keyout key.pem -out cert.pem
openssl req -new -config ssl.cfn -keyout cakey.pem -out req.pem
openssl ca -batch -config ssl.cfn -notext -extensions ca_cert -in req.pem -out cert.pem
mkdir private
ls private
ls
mv cakey.pem private
#secret
openssl genrsa -out rootca.key 2048
openssl req -x509 -new -nodes -key rootca.key -days 1024 -out rootca.pem
rm -fr inter_ca_demo
cd ..
# .......
mkdir private
cd private
mkdir root_ca inter_ca end_cert
cd root_ca
openssl genrsa -out rootca.key 2048
openssl req -x509 -new -nodes -key rootca.key -days 1024 -out rootca.pem
openssl x509 -noout -hash -in rootca.pem
ln -s rootca.pem f0973984.0
cd ../inter_ca
openssl genrsa -out inter.key 2048
openssl req -new -key inter.key -out inter.csr
echo 'basicConstraints=CA:TRUE' > v3x509extensions.txt
openssl x509 -req -extfile v3x509extensions.txt -in inter.csr -CA ../root_ca/rootca.pem -CAkey ../root_ca/rootca.key -CAcreateserial -out inter.crt -days 200
cd ../end_cert
openssl genrsa -out end.key 2048
openssl req -new -key end.key -out end.csr
openssl x509 -req -in end.csr -CA ../inter_ca/inter.crt -CAkey ../inter_ca/inter.key -CAcreateserial -out end.crt -days 500
cat ../inter_ca/inter.crt end.crt | openssl verify -CApath ../root_ca
cd end_cert
iex -S mix
iex
c "lib/gateway/gateway.ex"
Gateway.start 4043
#start multiple gateways