easy:SetOpt_HSTSReadFunction(hstsread[, userdata])
userdata
argument, the value you pass in userdata
will be passed to your callback function as
a parameter. The userdata
parameter can be of any type.
The callback function looks like this:
res, name, includeSubDomains, expire = hstsread([userdata]) |
You can see that your callback has to return four values:
res
#CURLSTS_OK
if it returns a name and is
prepared to be called again (for another host) or #CURLSTS_DONE
if it has
no entry to return. It can also return #CURLSTS_FAIL
to signal
error. Returning #CURLSTS_FAIL
will stop the transfer from being
performed and make #CURLE_ABORTED_BY_CALLBACK
get returned.
name
includeSubDomains
True
or False
signalling whether the entry matches subdomains.
expire
YYYYMMDD HH:MM:SS
.
This option does not enable HSTS, you need to use #CURLOPT_HSTS_CTRL
to
do that.