Add test scenario blocked-https-requests
authorFabian Keil <fk@fabiankeil.de>
Tue, 8 Feb 2022 12:22:11 +0000 (13:22 +0100)
committerFabian Keil <fk@fabiankeil.de>
Wed, 20 Mar 2024 11:38:39 +0000 (12:38 +0100)
Sponsored by: Privoxy project funds collected at SPI

tests/cts/blocked-https-requests/data/test1 [new file with mode: 0644]
tests/cts/blocked-https-requests/https-inspection.action [new file with mode: 0644]
tests/cts/blocked-https-requests/privoxy.conf [new file with mode: 0644]

diff --git a/tests/cts/blocked-https-requests/data/test1 b/tests/cts/blocked-https-requests/data/test1
new file mode 100644 (file)
index 0000000..b5e2140
--- /dev/null
@@ -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\r
+Host: %HOSTIP:%HTTPSPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</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 (file)
index 0000000..01b2181
--- /dev/null
@@ -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 (file)
index 0000000..fb2304a
--- /dev/null
@@ -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