Skip to content

Commit

Permalink
Add Test integ SSL client Authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricereix committed Jan 11, 2023
1 parent 0543431 commit 18f4ba1
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/test/test_prerequisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,10 @@ if ($LASTEXITCODE) { Throw }
sleep 5
if (netstat -ano | Select-String LISTENING | Select-string 127.0.0.1:8002) {powershell write-host -foregroundcolor Green "server-ssl-signedbyca up"} else {powershell write-host -foregroundcolor Red "server-ssl-signedbyca is down" ; exit 1}

Start-Process powershell -WindowStyle Hidden { python ssl/server.py 8003 ssl/server/cert.pem true 2>&1 > server-ssl-client-authent.log }
if ($LASTEXITCODE) { Throw }
sleep 5
if (netstat -ano | Select-String LISTENING | Select-string 127.0.0.1:8003) {powershell write-host -foregroundcolor Green "server-ssl-client-authent up"} else {powershell write-host -foregroundcolor Red "server-ssl-client-authent is down" ; exit 1}

cd $actual_dir

4 changes: 4 additions & 0 deletions bin/test/test_prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ echo -e "\n------------------ Starting ssl/server.py (Signed by CA)"
(python3 ssl/server.py 8002 ssl/server/cert.pem false > server-ssl-signedbyca.log 2>&1 || true) &
check_listen_port "ssl/server.py" 8002

echo -e "\n------------------ Starting ssl/server.py (Self-signed certificate + Client certificate authentication)"
(python3 ssl/server.py 8003 ssl/server/cert.selfsigned.pem true > server-ssl-client-authent.log 2>&1 || true) &
check_listen_port "ssl/server.py" 8003

echo -e "\n------------------ Starting mitmdump"
(mitmdump --listen-host 127.0.0.1 --listen-port 8888 --modify-header "/From-Proxy/Hello" >mitmproxy.log 2>&1 ||true) &
check_listen_port "mitmdump" 8888
Expand Down
2 changes: 2 additions & 0 deletions integration/ssl/client_authentication.curl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
curl --cacert ssl/server/cert.selfsigned.pem --cert ssl/client/cert.pem --key ssl/client/key.pem 'https://localhost:8003/hello'

1 change: 1 addition & 0 deletions integration/ssl/client_authentication.exit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
3 changes: 3 additions & 0 deletions integration/ssl/client_authentication.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GET https://localhost:8003/hello
HTTP 200

6 changes: 6 additions & 0 deletions integration/ssl/client_authentication.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--cacert
ssl/server/cert.selfsigned.pem
--cert
ssl/client/cert.pem
--key
ssl/client/key.pem

0 comments on commit 18f4ba1

Please sign in to comment.