diff --git a/bin/test/test_prerequisites.ps1 b/bin/test/test_prerequisites.ps1 index 174337664..6e9c670d0 100644 --- a/bin/test/test_prerequisites.ps1 +++ b/bin/test/test_prerequisites.ps1 @@ -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 diff --git a/bin/test/test_prerequisites.sh b/bin/test/test_prerequisites.sh index 0aaa3a828..14e4b280d 100755 --- a/bin/test/test_prerequisites.sh +++ b/bin/test/test_prerequisites.sh @@ -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 diff --git a/integration/ssl/client_authentication.curl b/integration/ssl/client_authentication.curl new file mode 100644 index 000000000..4a03a6879 --- /dev/null +++ b/integration/ssl/client_authentication.curl @@ -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' + diff --git a/integration/ssl/client_authentication.exit b/integration/ssl/client_authentication.exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/integration/ssl/client_authentication.exit @@ -0,0 +1 @@ +0 diff --git a/integration/ssl/client_authentication.hurl b/integration/ssl/client_authentication.hurl new file mode 100644 index 000000000..396e0ba2e --- /dev/null +++ b/integration/ssl/client_authentication.hurl @@ -0,0 +1,3 @@ +GET https://localhost:8003/hello +HTTP 200 + diff --git a/integration/ssl/client_authentication.options b/integration/ssl/client_authentication.options new file mode 100644 index 000000000..464d83e02 --- /dev/null +++ b/integration/ssl/client_authentication.options @@ -0,0 +1,6 @@ +--cacert +ssl/server/cert.selfsigned.pem +--cert +ssl/client/cert.pem +--key +ssl/client/key.pem