Skip to content

Commit 27ead39

Browse files
author
=
committed
add ssl test
1 parent a64e9ba commit 27ead39

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,34 @@ jobs:
66
test:
77
runs-on: ubuntu-latest
88
steps:
9+
- name: build
10+
run: cargo build
911
- name: start and hit no-ssl
1012
shell: bash
1113
run: |
12-
cargo build
1314
./target/debug/cosock-test-server &
1415
sleep 1
1516
SERVER_PID=$!
1617
curl http://127.0.0.1:8080/delay/3
1718
kill $SERVER_PID
19+
- name: install certs
20+
run: |
21+
openssl req \
22+
-newkey rsa:2048 \
23+
-x509 \
24+
-sha256 \
25+
-days 10000 \
26+
-nodes \
27+
-out cert.pem \
28+
-keyout key.pem \
29+
-subj "/C=US/ST=MN/L=Minneapolis/O=cosock/" \
30+
&& cp cert.pem /usr/local/share/ca-certificates \
31+
&& update-ca-certificates
32+
- name: run-with-tls
33+
run: |
34+
./target/debug/cosock-test-server 8443 . &
35+
sleep 1
36+
SERVER_PID=$!
37+
curl https://127.0.0.1:8080/delay/3
38+
kill $SERVER_PID
39+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/**/.DS_Store
22
/target
3+
/*.pem

0 commit comments

Comments
 (0)