From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 8 Feb 2022 12:22:11 +0000 (+0100)
Subject: Add test scenario blocked-https-requests
X-Git-Tag: v_4_0_0~86
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/developer-manual/@default-cgi@send-stylesheet?a=commitdiff_plain;h=346132dd243585f57b0255310449f95619ba0c8b;p=privoxy.git

Add test scenario blocked-https-requests

Sponsored by: Privoxy project funds collected at SPI
---

diff --git a/tests/cts/blocked-https-requests/data/test1 b/tests/cts/blocked-https-requests/data/test1
new file mode 100644
index 00000000..b5e2140f
--- /dev/null
+++ b/tests/cts/blocked-https-requests/data/test1
@@ -0,0 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTPS
+HTTP GET
+</keywords>
+</info>
+
+<reply>
+<data>
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/html
+Content-Length: 18
+
+Here's your data.
+</data>
+</reply>
+
+<proxy-reply>
+<data>
+HTTP/1.1 200 Connection established
+
+HTTP/1.1 200 OK
+Connection: close
+Content-Type: text/html
+Content-Length: 18
+
+Here's your data.
+</data>
+</proxy-reply>
+
+<client>
+<server>
+https
+</server>
+<name>
+Blocked https request followed by unblocked request for the same host which means the connection can't be reused
+</name>
+<command>
+--insecure -s --write-out '%{stderr}%{response_code}\n' https://%HOSTIP:%HTTPSPORT/ads/%TESTNUMBER --output log/curl1.out https://%HOSTIP:%HTTPSPORT/%TESTNUMBER
+</command>
+</client>
+
+<verify>
+<protocol>
+GET /%TESTNUMBER HTTP/1.1
+Host: %HOSTIP:%HTTPSPORT
+User-Agent: curl/%VERSION
+Accept: */*
+
+</protocol>
+<stderr>
+403
+200
+</stderr>
+</verify>
+</testcase>
diff --git a/tests/cts/blocked-https-requests/https-inspection.action b/tests/cts/blocked-https-requests/https-inspection.action
new file mode 100644
index 00000000..01b2181d
--- /dev/null
+++ b/tests/cts/blocked-https-requests/https-inspection.action
@@ -0,0 +1,2 @@
+{+https-inspection +ignore-certificate-errors}
+/
diff --git a/tests/cts/blocked-https-requests/privoxy.conf b/tests/cts/blocked-https-requests/privoxy.conf
new file mode 100644
index 00000000..fb2304aa
--- /dev/null
+++ b/tests/cts/blocked-https-requests/privoxy.conf
@@ -0,0 +1,31 @@
+listen-address 127.0.0.1:9119
+
+ca-directory          ../ca-directory
+ca-cert-file          privoxy-test-cacert.crt
+ca-key-file           privoxy-test-cakey.pem
+ca-password           blafasel
+# We don't check certificate anyway
+trusted-cas-file      privoxy-test-cacert.crt
+
+certificate-directory ../certs
+
+debug     1 # Log the destination for each request Privoxy let through. See also debug 1024.
+debug     2 # show each connection status
+debug     4 # show tagging-related messages
+debug     8 # show header parsing
+debug    32 # debug force feature
+debug    64 # debug regular expression filters
+debug   128 # debug redirects
+debug   256 # debug GIF de-animation
+debug   512 # Common Log Format
+debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
+debug  4096 # Startup banner and warnings.
+debug  8192 # Non-fatal errors
+
+actionsfile https-inspection.action
+actionsfile ../../../default.action.master
+filterfile  ../../../default.filter
+
+templdir ../../../templates
+
+keep-alive-timeout 15