diff options
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/Makefile.inc | 2 | ||||
-rw-r--r-- | tests/data/hsts.dafsa | 2 | ||||
-rw-r--r-- | tests/data/hsts.json | 9 | ||||
-rw-r--r-- | tests/data/test2087 | 46 | ||||
-rw-r--r-- | tests/data/test2088 | 45 |
5 files changed, 104 insertions, 0 deletions
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index fc22c2f17..0b1344374 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -203,6 +203,8 @@ test2064 test2065 test2066 test2067 test2068 test2069 \ test2071 test2072 test2073 test2074 test2075 test2076 test2077 \ test2078 \ test2080 \ +test2087 test2088 \ +\ test2100 \ \ test3000 test3001 diff --git a/tests/data/hsts.dafsa b/tests/data/hsts.dafsa new file mode 100644 index 000000000..447f9540a --- /dev/null +++ b/tests/data/hsts.dafsa @@ -0,0 +1,2 @@ +.DAFSA@HSTS_0 +hstsdomain.fake
\ No newline at end of file diff --git a/tests/data/hsts.json b/tests/data/hsts.json new file mode 100644 index 000000000..f506f8953 --- /dev/null +++ b/tests/data/hsts.json @@ -0,0 +1,9 @@ +{ + "entries": [ + { "name": "hstsdomain.fake", + "policy": "test", + "include_subdomains": true, + "mode": "force-https" + } + ] +} diff --git a/tests/data/test2087 b/tests/data/test2087 new file mode 100644 index 000000000..c9f7e6f1d --- /dev/null +++ b/tests/data/test2087 @@ -0,0 +1,46 @@ +<testcase> +<info> +<keywords> +HSTS +HTTP +</keywords> +</info> + +# Client-side +<client> +<features> +HSTS +debug +</features> +<server> +http +http-proxy +</server> +<name> +Check that HSTS does not upgrade domain without record +</name> +<setenv> +CURL_HSTSFILE=data/hsts.dafsa +</setenv> +<command> +-x %HOSTIP:%PROXYPORT http://nohstsdomain.fake/ +</command> +</client> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<proxy> +GET http://nohstsdomain.fake/ HTTP/1.1
+Host: nohstsdomain.fake
+Accept: */*
+Proxy-Connection: Keep-Alive
+
+</proxy> +<errorcode> +0 +</errorcode> +</verify> +</testcase> diff --git a/tests/data/test2088 b/tests/data/test2088 new file mode 100644 index 000000000..569ac02f0 --- /dev/null +++ b/tests/data/test2088 @@ -0,0 +1,45 @@ +<testcase> +<info> +<keywords> +HSTS +HTTPS +</keywords> +</info> + +# Client-side +<client> +<features> +HSTS +debug +</features> +<server> +https +http-proxy +</server> +<name> +Check that HSTS upgrades http to https +</name> +<setenv> +CURL_HSTSFILE=data/hsts.dafsa +</setenv> +<command> +-x %HOSTIP:%PROXYPORT http://hstsdomain.fake/ +</command> +</client> + +# Verify data after the test has been "shot" +<verify> +<strip> +^User-Agent:.* +</strip> +<proxy> +CONNECT hstsdomain.fake:443 HTTP/1.1
+Host: hstsdomain.fake:443
+Proxy-Connection: Keep-Alive
+
+</proxy> +<errorcode> +56 +</errorcode> +</verify> +</testcase> |