Add Test integ SSL client Authentication

This commit is contained in:
Fabrice Reix 2023-01-11 15:44:04 +01:00
parent 0543431490
commit 18f4ba1afe
No known key found for this signature in database
GPG Key ID: 8D3D9DBDD96B2D30
6 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,3 @@
GET https://localhost:8003/hello
HTTP 200

View File

@ -0,0 +1,6 @@
--cacert
ssl/server/cert.selfsigned.pem
--cert
ssl/client/cert.pem
--key
ssl/client/key.pem