-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
36 lines (26 loc) · 1.21 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
MYPATH=$(HOME)/projects/httpsnow/
openssl=/usr/bin/openssl
bash=/bin/bash
all: localhostCA.crt server.crt
localhostCA.key:
$(openssl) genrsa -out localhostCA.key 2048
localhostCA.pem: localhostCA.key # generate-ca.sh
$(openssl) req -x509 -new -nodes -key localhostCA.key \
-subj "/C=CA/ST=AB/L=EDMONTON/O=httpsnow/CN=localhost" \
-sha256 -days 3650 -out localhostCA.pem
localhostCA.crt: localhostCA.key
$(openssl) req -new -x509 -days 3650 -key localhostCA.key \
-subj "/C=CA/ST=AB/L=EDMONTON/O=httpsnow/CN=localhost" \
-out localhostCA.crt
server.key:
$(openssl) genrsa -out server.key 2048
server.csr: server.key localhostCA.pem
$(openssl) req -new -key server.key -out server.csr -subj "/C=CA/ST=AB/L=EDMONTON/O=httpsnow/CN=localhost"
server.crt: server.csr localhostCA.pem
$(openssl) x509 -req -in server.csr -CA localhostCA.pem -CAkey localhostCA.key -CAcreateserial -out server.crt -days 3650 -sha256 -extfile v3.ext
install: install.sh server.crt localhostCA.pem localhostCA.crt
$(bash) install.sh
serve:
$(openssl) s_server -accept 44330 -cert $(MYPATH)/server.crt -key $(MYPATH)/server.key -WWW
clean:
rm localhostCA.key localhostCA.srl server.csr localhostCA.crt localhostCA.pem server.crt server.key