File tree Expand file tree Collapse file tree 6 files changed +82
-0
lines changed
Expand file tree Collapse file tree 6 files changed +82
-0
lines changed Original file line number Diff line number Diff line change 1+ configurationset :
2+ - configuration :
3+ name : selfsign
4+ ca : STEPZEN_SERVER_CRT
5+ - configuration :
6+ name : selfsignedmtls
7+ ca : STEPZEN_SERVER_CRT
8+ cert : STEPZEN_CLIENT_CRT
9+ key : STEPZEN_CLIENT_KEY
Original file line number Diff line number Diff line change 1+ schema @sdl (files : ["tls.graphql" ]) {
2+ query : Query
3+ }
4+
Original file line number Diff line number Diff line change 1+ query run {
2+ rest_self
3+ rest_self_mtls
4+ }
Original file line number Diff line number Diff line change 1+ {
2+ "endpoint" : " api/miscellaneous"
3+ }
Original file line number Diff line number Diff line change 1+ # Makefile to build and validate a pair of *example* self-signed certificates for *simple* tests
2+
3+ # enable to debug ssl server
4+ # DEBUG:=-debug
5+ all : client.crt server.crt env
6+
7+ # server.crt client.key server.key
8+ client.crt :
9+ openssl req -x509 -newkey rsa:4096 -keyout client.key -out client.crt -sha256 -days 7650 \
10+ -subj "/C=US/ST=Florida/L=Jacksonville/O=LOCALCLIENT/OU=Com/CN=localhost" -nodes \
11+ -addext "subjectAltName = DNS :localhost, DNS:myalt, DNS:host.docker.internal"
12+
13+ server.crt :
14+ openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -sha256 -days 7650 \
15+ -subj "/C=US/ST=California/L=San Jose/O=LOCALSERVER/OU=Com/CN=localhost" -nodes \
16+ -addext "subjectAltName = DNS :localhost, DNS:host.docker.internal"
17+
18+ run_validation_server_self_sign_mtls : server.crt client.crt
19+ openssl s_server -accept 9443 -cert server.crt -key server.key -Verify 2 -CAfile client.crt $(DEBUG ) -www
20+
21+ run_validation_client_self_sign_mtls : client.crt
22+ curl --cert client.crt --key client.key --cacert server.crt https://localhost:9443 -debug
23+
24+ run_validation_server_self_sign : server.crt
25+ openssl s_server -accept 8443 -cert server.crt -key server.key $(DEBUG ) -www
26+
27+ clean :
28+ rm -f server.crt server.key client.crt client.key
29+
30+ env : ../.env
31+
32+ ../.env : client.crt server.crt
33+ ( echo STEPZEN_CLIENT_CRT=\" " ` cat client.crt` " \" ; \
34+ echo STEPZEN_CLIENT_KEY=\" " ` cat client.key` " \" ; \
35+ echo STEPZEN_SERVER_CRT=\" " ` cat server.crt` " \" ) > ../.env
Original file line number Diff line number Diff line change 1+ type Query {
2+ """
3+ will contact localhost using host.docker.internal and 8443 and selfsign configuration
4+ the ecmascript is used to repackage any content coming back (openssl s_server returns html)
5+ """
6+ rest_self : JSON
7+ @rest (
8+ endpoint : " https://host.docker.internal:8443/"
9+ tls : " selfsign"
10+ ecmascript : " " "
11+ function transformREST(s) { return JSON.stringify({data100: s.length>100, accept_8443: s.includes(" -accept 8443 ")})}
12+ """
13+ )
14+
15+ """
16+ will contact localhost using host.docker.internal and 9443 and mtls configuration
17+ the ecmascript is used to repackage any content coming back (openssl s_server returns html)
18+ """
19+ rest_self_mtls : JSON
20+ @rest (
21+ endpoint : " https://host.docker.internal:9443/"
22+ tls : " selfsignedmtls"
23+ ecmascript : " " "
24+ function transformREST(s) { return JSON.stringify({data100: s.length>100, accept_9443: s.includes(" -accept 9443 ")})}
25+ """
26+ )
27+ }
You can’t perform that action at this time.
0 commit comments