]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test446: verify hsts with two URLs
authorDaniel Stenberg <daniel@haxx.se>
Tue, 27 Dec 2022 10:50:23 +0000 (11:50 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 27 Dec 2022 14:22:32 +0000 (15:22 +0100)
tests/data/Makefile.inc
tests/data/test446 [new file with mode: 0644]

index 3a6356bd122bc95284cb1310435778d6279ecc83..fe1bb1c74c2ab9cf4d49df43562990cc5d0f1a5f 100644 (file)
@@ -71,7 +71,7 @@ test408 test409 test410 test411 test412 test413 test414 test415 test416 \
 \
 test430 test431 test432 test433 test434 test435 test436 \
 \
-test440 test441 test442 test443 test444 test445 \
+test440 test441 test442 test443 test444 test445 test446 \
 \
 test490 test491 test492 test493 test494 test495 test496 \
 \
diff --git a/tests/data/test446 b/tests/data/test446
new file mode 100644 (file)
index 0000000..0e2dfdc
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP proxy
+HSTS
+trailing-dot
+</keywords>
+</info>
+
+<reply>
+
+# we use this as response to a CONNECT
+<connect nocheck="yes">
+HTTP/1.1 200 OK\r
+\r
+</connect>
+<data crlf="yes">
+HTTP/1.1 200 OK
+Content-Length: 6
+Strict-Transport-Security: max-age=604800
+
+-foo-
+</data>
+<data2 crlf="yes">
+HTTP/1.1 200 OK
+Content-Length: 6
+Strict-Transport-Security: max-age=6048000
+
+-baa-
+</data2>
+</reply>
+
+<client>
+<server>
+https
+http-proxy
+</server>
+<features>
+HSTS
+proxy
+https
+debug
+</features>
+<setenv>
+CURL_HSTS_HTTP=yes
+CURL_TIME=2000000000
+</setenv>
+
+<name>
+HSTS with two URLs
+</name>
+<command>
+-x http://%HOSTIP:%PROXYPORT --hsts log/hsts%TESTNUMBER http://this.hsts.example./%TESTNUMBER http://another.example.com/%TESTNUMBER0002
+</command>
+</client>
+
+<verify>
+# we let it CONNECT to the server to confirm HSTS but deny from there
+<proxy crlf="yes">
+GET http://this.hsts.example./%TESTNUMBER HTTP/1.1
+Host: this.hsts.example.
+User-Agent: curl/%VERSION
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+GET http://another.example.com/%TESTNUMBER0002 HTTP/1.1
+Host: another.example.com
+User-Agent: curl/%VERSION
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</proxy>
+
+<file name="log/hsts%TESTNUMBER" mode="text">
+# Your HSTS cache. https://curl.se/docs/hsts.html
+# This file was generated by libcurl! Edit at your own risk.
+this.hsts.example "20330525 03:33:20"
+another.example.com "20330727 03:33:20"
+</file>
+
+</verify>
+</testcase>