hsts: add read/write callbacks

- read/write callback options
- man pages for the 4 new setopts
- test 1915 verifies the callbacks

Closes #5896
This commit is contained in:
Daniel Stenberg 2020-11-02 23:17:01 +01:00
parent 7385610d0c
commit 2cfc4ed983
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
27 changed files with 652 additions and 22 deletions

View file

@ -204,7 +204,7 @@ test1700 test1701 test1702 \
test1800 test1801 \
\
test1904 test1905 test1906 test1907 \
test1908 test1909 test1910 test1911 test1912 test1913 test1914 \
test1908 test1909 test1910 test1911 test1912 test1913 test1914 test1915 \
\
test2000 test2001 test2002 test2003 test2004 test2005 test2006 test2007 \
test2008 test2009 test2010 test2011 test2012 test2013 test2014 test2015 \

50
tests/data/test1915 Normal file
View file

@ -0,0 +1,50 @@
<testcase>
<info>
<keywords>
HTTP
HSTS
CURLOPT_HSTSREADFUNCTION
</keywords>
</info>
# Server-side
<reply>
</reply>
# Client-side
<client>
<features>
HSTS
http
</features>
<server>
none
</server>
# require debug so that alt-svc can work over plain old HTTP
<name>
HSTS read/write callbacks
</name>
<tool>
lib1915
</tool>
<command>
http://%HOSTIP:%NOLISTENPORT/not-there/1915
</command>
</client>
# Verify data after the test has been "shot"
<verify>
# it fails because there's nothing on that port
<errorcode>
7
</errorcode>
<stdout>
[0/4] 1.example.com 20300320 01:02:03
[1/4] 2.example.com 20300320 01:02:03
[2/4] 3.example.com 20300320 01:02:03
[3/4] 4.example.com 20300320 01:02:03
</stdout>
</verify>
</testcase>