• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From ea5aaaa5ede53819f8bc7ae767fc2d13d3704d37 Mon Sep 17 00:00:00 2001
2From: Daniel Stenberg <daniel@haxx.se>
3Date: Tue, 27 Dec 2022 11:50:23 +0100
4Subject: [PATCH] test446: verify hsts with two URLs
5
6Conflict: Context adaptation
7Reference: https://github.com/curl/curl/commit/ea5aaaa5ede53819f8bc7ae767fc2d13d3704d37
8---
9 tests/data/Makefile.inc |  2 +-
10 tests/data/test446      | 84 +++++++++++++++++++++++++++++++++++++++++
11 2 files changed, 85 insertions(+), 1 deletion(-)
12 create mode 100644 tests/data/test446
13
14diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
15index f79b63e..879d846 100644
16--- a/tests/data/Makefile.inc
17+++ b/tests/data/Makefile.inc
18@@ -67,7 +67,7 @@ test392 test393 test394 test395 test396 test397 \
19 test400 test401 test402 test403 test404 test405 test406 test407 test408 \
20 test409 test410 \
21 \
22-test430 test431 test432 test433 test434 test435 test445\
23+test430 test431 test432 test433 test434 test435 test445 test446\
24 \
25 test490 test491 test492 test493 test494 \
26 \
27diff --git a/tests/data/test446 b/tests/data/test446
28new file mode 100644
29index 0000000..eda3022
30--- /dev/null
31+++ b/tests/data/test446
32@@ -0,0 +1,84 @@
33+<?xml version="1.0" encoding="ISO-8859-1"?>
34+<testcase>
35+<info>
36+<keywords>
37+HTTP
38+HTTP proxy
39+HSTS
40+trailing-dot
41+</keywords>
42+</info>
43+
44+<reply>
45+
46+# we use this as response to a CONNECT
47+<connect nocheck="yes">
48+HTTP/1.1 200 OK
49+
50+</connect>
51+<data crlf="yes">
52+HTTP/1.1 200 OK
53+Content-Length: 6
54+Strict-Transport-Security: max-age=604800
55+
56+-foo-
57+</data>
58+<data2 crlf="yes">
59+HTTP/1.1 200 OK
60+Content-Length: 6
61+Strict-Transport-Security: max-age=6048000
62+
63+-baa-
64+</data2>
65+</reply>
66+
67+<client>
68+<server>
69+https
70+http-proxy
71+</server>
72+<features>
73+HSTS
74+proxy
75+https
76+debug
77+</features>
78+<setenv>
79+CURL_HSTS_HTTP=yes
80+CURL_TIME=2000000000
81+</setenv>
82+
83+<name>
84+HSTS with two URLs
85+</name>
86+<command>
87+-x http://%HOSTIP:%PROXYPORT --hsts log/hsts%TESTNUMBER http://this.hsts.example./%TESTNUMBER http://another.example.com/%TESTNUMBER0002
88+</command>
89+</client>
90+
91+<verify>
92+# we let it CONNECT to the server to confirm HSTS but deny from there
93+<proxy crlf="yes">
94+GET http://this.hsts.example./%TESTNUMBER HTTP/1.1
95+Host: this.hsts.example.
96+User-Agent: curl/%VERSION
97+Accept: */*
98+Proxy-Connection: Keep-Alive
99+
100+GET http://another.example.com/%TESTNUMBER0002 HTTP/1.1
101+Host: another.example.com
102+User-Agent: curl/%VERSION
103+Accept: */*
104+Proxy-Connection: Keep-Alive
105+
106+</proxy>
107+
108+<file name="log/hsts%TESTNUMBER" mode="text">
109+# Your HSTS cache. https://curl.se/docs/hsts.html
110+# This file was generated by libcurl! Edit at your own risk.
111+this.hsts.example "20330525 03:33:20"
112+another.example.com "20330727 03:33:20"
113+</file>
114+
115+</verify>
116+</testcase>
117--
1182.33.0
119
120