[luci] allow httpclient to perform peer certificate validation

This commit is contained in:
Bart Van Der Meerssche 2011-03-05 00:07:56 +01:00
parent e5c1cd9f00
commit a826343f6c
1 changed files with 7 additions and 0 deletions

View File

@ -138,6 +138,13 @@ function request_raw(uri, options)
if pr == "https" then
local tls = options.tls_context or nixio.tls()
local tls_context_set_verify = options.tls_context_set_verify or "none"
if tls_context_set_verify == "peer" then
tls:set_verify("peer")
tls:set_verify_locations("/etc/ssl/certs/flukso.ca.crt")
end
sock = tls:create(sock)
local stat, code, error = sock:connect()
if not stat then