-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (33 loc) · 2.03 KB
/
Makefile
File metadata and controls
43 lines (33 loc) · 2.03 KB
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
CERTSUBJ := /C=JP/ST=Tokyo/O='sqlx-scylladb'
CERTSAN := IP:127.0.0.1,DNS:scylladb,DNS:*.internal,DNS:*.local,DNS:localhost
CERTDIR := sqlx-scylladb/tests/certs
CACERT := $(CERTDIR)/ca-cert.pem
CAKEY := $(CERTDIR)/ca-key.pem
CACSR := $(CERTDIR)/ca-csr.pem
SRVCERTKEY := $(CERTDIR)/server-key.pem
SRVCERTCSR := $(CERTDIR)/server-csr.pem
SRVCERT := $(CERTDIR)/server-cert.pem
CERTKEY := $(CERTDIR)/client-key.pem
CERTCSR := $(CERTDIR)/client-csr.pem
CERT := $(CERTDIR)/client-cert.pem
TEST_FEATURES := time-03,chrono-04,bigdecimal-04,secrecy-08
OPENSSL_TEST_FEATURES := migrate,openssl-010
RUSTLS_TEST_FEATURES := migrate,rustls-023
mkcert:
openssl genpkey -algorithm ec -pkeyopt ec_paramgen_curve:P-256 -out $(CAKEY) # CA秘密鍵の作成
openssl req -new -key $(CAKEY) -out $(CACSR) -subj $(CERTSUBJ) # 証明書署名要求の作成
openssl x509 -req -in $(CACSR) -signkey $(CAKEY) -days 3650 -out $(CACERT) # 認証局による公開鍵への自己署名
openssl genpkey -algorithm ec -pkeyopt ec_paramgen_curve:P-256 -out $(SRVCERTKEY) # 秘密鍵の作成
openssl req -new -key $(SRVCERTKEY) -out $(SRVCERTCSR) -subj $(CERTSUBJ) -addext 'subjectAltName = $(CERTSAN)' # 証明書署名要求の作成
openssl x509 -req -in $(SRVCERTCSR) -CA $(CACERT) -CAkey $(CAKEY) -CAcreateserial -days 3650 -copy_extensions copy -out $(SRVCERT) # 認証局による証明書発行
openssl genpkey -algorithm ec -pkeyopt ec_paramgen_curve:P-256 -out $(CERTKEY) # 秘密鍵の作成
openssl req -new -key $(CERTKEY) -out $(CERTCSR) -subj $(CERTSUBJ) -addext 'subjectAltName = $(CERTSAN)' # 証明書署名要求の作成
openssl x509 -req -in $(CERTCSR) -CA $(CACERT) -CAkey $(CAKEY) -CAcreateserial -days 3650 -copy_extensions copy -out $(CERT) # 認証局による証明書発行
chmod 0644 $(CERTDIR)/*.pem
test:
cargo test --features $(TEST_FEATURES)
test-openssl:
cargo test --features $(OPENSSL_TEST_FEATURES) it_can_connect_by_openssl
test-rustls:
cargo test --features $(RUSTLS_TEST_FEATURES) it_can_connect_by_rustls
.PHONY: mkcert test test-openssl test-rustls