]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test440/441: verify HSTS with trailing dots
authorDaniel Stenberg <daniel@haxx.se>
Mon, 9 May 2022 06:13:54 +0000 (08:13 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 9 May 2022 10:54:39 +0000 (12:54 +0200)
tests/data/Makefile.inc
tests/data/test440 [new file with mode: 0644]
tests/data/test441 [new file with mode: 0644]

index c032c14ed597f1a58ce0a2da6375ead82c1b743f..7fe1d54c24d7c9914897f05eeb7163020f5351e2 100644 (file)
@@ -72,6 +72,8 @@ test409 test410 test411 test412 test413 \
 \
 test430 test431 test432 test433 test434 test435 test436 \
 \
+test440 test441 \
+\
 test490 test491 test492 test493 test494 \
 \
 test500 test501 test502 test503 test504 test505 test506 test507 test508 \
diff --git a/tests/data/test440 b/tests/data/test440
new file mode 100644 (file)
index 0000000..c640b02
--- /dev/null
@@ -0,0 +1,72 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HSTS
+trailing-dot
+</keywords>
+</info>
+
+<reply>
+
+# we use this as response to a CONNECT
+<connect nocheck="yes">
+HTTP/1.1 403 not OK at all\r
+Date: Tue, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Length: 6\r
+Connection: close\r
+Funny-head: yesyes\r
+\r
+-foo-
+</connect>
+</reply>
+
+<client>
+<server>
+http
+</server>
+<features>
+HSTS
+proxy
+https
+</features>
+
+# no trailing dot in the file only in the URL
+<file name="log/input%TESTNUMBER">
+this.hsts.example "99991001 04:47:41"
+</file>
+
+<name>
+HSTS with trailing-dot host name in URL but none in hsts file
+</name>
+<command>
+-x http://%HOSTIP:%HTTPPORT http://this.hsts.example./%TESTNUMBER --hsts log/input%TESTNUMBER -w '%{url_effective}\n'
+</command>
+</client>
+
+<verify>
+# we let it CONNECT to the server to confirm HSTS but deny from there
+<protocol>
+CONNECT this.hsts.example.:443 HTTP/1.1\r
+Host: this.hsts.example.:443\r
+User-Agent: curl/%VERSION\r
+Proxy-Connection: Keep-Alive\r
+\r
+</protocol>
+<stdout>
+HTTP/1.1 403 not OK at all\r
+Date: Tue, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Length: 6\r
+Connection: close\r
+Funny-head: yesyes\r
+\r
+https://this.hsts.example./%TESTNUMBER
+</stdout>
+# Proxy CONNECT aborted
+<errorcode>
+56
+</errorcode>
+</verify>
+</testcase>
diff --git a/tests/data/test441 b/tests/data/test441
new file mode 100644 (file)
index 0000000..7f5245b
--- /dev/null
@@ -0,0 +1,72 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HSTS
+trailing-dot
+</keywords>
+</info>
+
+<reply>
+
+# we use this as response to a CONNECT
+<connect nocheck="yes">
+HTTP/1.1 403 not OK at all\r
+Date: Tue, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Length: 6\r
+Connection: close\r
+Funny-head: yesyes\r
+\r
+-foo-
+</connect>
+</reply>
+
+<client>
+<server>
+http
+</server>
+<features>
+HSTS
+proxy
+https
+</features>
+
+# no trailing dot in the file only in the URL
+<file name="log/input%TESTNUMBER">
+this.hsts.example. "99991001 04:47:41"
+</file>
+
+<name>
+HSTS with no t-dot host name in URL but t-dot in file
+</name>
+<command>
+-x http://%HOSTIP:%HTTPPORT http://this.hsts.example/%TESTNUMBER --hsts log/input%TESTNUMBER -w '%{url_effective}\n'
+</command>
+</client>
+
+<verify>
+# we let it CONNECT to the server to confirm HSTS but deny from there
+<protocol>
+CONNECT this.hsts.example:443 HTTP/1.1\r
+Host: this.hsts.example:443\r
+User-Agent: curl/%VERSION\r
+Proxy-Connection: Keep-Alive\r
+\r
+</protocol>
+<stdout>
+HTTP/1.1 403 not OK at all\r
+Date: Tue, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Length: 6\r
+Connection: close\r
+Funny-head: yesyes\r
+\r
+https://this.hsts.example/%TESTNUMBER
+</stdout>
+# Proxy CONNECT aborted
+<errorcode>
+56
+</errorcode>
+</verify>
+</testcase>