-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 1.22 KB
/
Makefile
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
.EXPORT_ALL_VARIABLES:
LD_LIBRARY_PATH = .
GRPC_TRACE = all
client:
python3 ChatApplication.py
server:
python3 server.py
init:
python3 -m grpc_tools.protoc -I=. proto/*.proto --python_out=. --grpc_python_out=.
define domain
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
DNS.2 = fake1.local
DNS.3 = fake2.local
endef
cert:
echo "$$domain" > domains.ext
openssl req -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout RootCA.key -out RootCA.pem -subj "/C=US/CN=Example-Root-CA"
openssl x509 -outform pem -in RootCA.pem -out RootCA.crt
openssl req -new -nodes -newkey rsa:2048 -keyout localhost.key -out localhost.csr -subj "/C=US/ST=YourState/L=YourCity/O=Example-Certificates/CN=localhost.local"
openssl x509 -req -sha256 -days 1024 -in localhost.csr -CA RootCA.pem -CAkey RootCA.key -CAcreateserial -extfile domains.ext -out localhost.crt
clear_cert:
rm -f RootCA.pem RootCA.crt RootCA.srl RootCA.key localhost.key localhost.crt localhost.csr key.pem certificate.pem domains.ext
clear_json:
rm -f *.json
clear_db:
rm -f *.db
clean: clear_cert clear_json clear_db