LuCId: DER certificate / key support
This commit is contained in:
parent
0ebce1d608
commit
c766f9750f
1 changed files with 8 additions and 3 deletions
|
@ -172,13 +172,18 @@ end
|
||||||
function prepare_tls(tlskey)
|
function prepare_tls(tlskey)
|
||||||
local tls = nixio.tls("server")
|
local tls = nixio.tls("server")
|
||||||
if tlskey and cursor:get(UCINAME, tlskey) then
|
if tlskey and cursor:get(UCINAME, tlskey) then
|
||||||
|
local xtype = cursor:get(UCINAME, tlskey, "type")
|
||||||
local cert = cursor:get(UCINAME, tlskey, "cert")
|
local cert = cursor:get(UCINAME, tlskey, "cert")
|
||||||
if cert then
|
if cert then
|
||||||
tls:set_cert(cert)
|
if not tls:set_cert(cert, xtype) then
|
||||||
|
nixio.syslog("err", "Unable to load certificate: " .. cert)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
local key = cursor:get(UCINAME, tlskey, "key")
|
local key = cursor:get(UCINAME, tlskey, "key")
|
||||||
if key then
|
if key then
|
||||||
tls:set_key(key)
|
if not tls:set_key(key, xtype) then
|
||||||
|
nixio.syslog("err", "Unable to load private key: " .. key)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
local ciphers = cursor:get(UCINAME, tlskey, "ciphers")
|
local ciphers = cursor:get(UCINAME, tlskey, "ciphers")
|
||||||
if ciphers then
|
if ciphers then
|
||||||
|
|
Loading…
Reference in a new issue