From: Daniel Stenberg Date: Tue, 27 Dec 2022 10:50:23 +0000 (+0100) Subject: test446: verify hsts with two URLs X-Git-Tag: curl-7_88_0~218 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea5aaaa5ede53819f8bc7ae767fc2d13d3704d37;p=thirdparty%2Fcurl.git test446: verify hsts with two URLs --- diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 3a6356bd12..fe1bb1c74c 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -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 index 0000000000..0e2dfdcfe3 --- /dev/null +++ b/tests/data/test446 @@ -0,0 +1,84 @@ + + + + +HTTP +HTTP proxy +HSTS +trailing-dot + + + + + +# we use this as response to a CONNECT + +HTTP/1.1 200 OK + + + +HTTP/1.1 200 OK +Content-Length: 6 +Strict-Transport-Security: max-age=604800 + +-foo- + + +HTTP/1.1 200 OK +Content-Length: 6 +Strict-Transport-Security: max-age=6048000 + +-baa- + + + + + +https +http-proxy + + +HSTS +proxy +https +debug + + +CURL_HSTS_HTTP=yes +CURL_TIME=2000000000 + + + +HSTS with two URLs + + +-x http://%HOSTIP:%PROXYPORT --hsts log/hsts%TESTNUMBER http://this.hsts.example./%TESTNUMBER http://another.example.com/%TESTNUMBER0002 + + + + +# we let it CONNECT to the server to confirm HSTS but deny from there + +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 + + + + +# 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" + + + +