summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-06-07 11:38:20 +0000
committerSteven Barth <steven@midlink.org>2009-06-07 11:38:20 +0000
commitc766f9750f8d0ff1aa6e40da4df3f3e4faba8eb5 (patch)
treed753f5f1813dc8a77b242d6a775e67e64815c424 /libs
parent0ebce1d6088a3a503ab038fd5ab81357ccabe625 (diff)
LuCId: DER certificate / key support
Diffstat (limited to 'libs')
-rw-r--r--libs/lucid/luasrc/lucid/tcpserver.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/lucid/luasrc/lucid/tcpserver.lua b/libs/lucid/luasrc/lucid/tcpserver.lua
index db94ba0ec..60fad8b2f 100644
--- a/libs/lucid/luasrc/lucid/tcpserver.lua
+++ b/libs/lucid/luasrc/lucid/tcpserver.lua
@@ -172,13 +172,18 @@ end
function prepare_tls(tlskey)
local tls = nixio.tls("server")
if tlskey and cursor:get(UCINAME, tlskey) then
+ local xtype = cursor:get(UCINAME, tlskey, "type")
local cert = cursor:get(UCINAME, tlskey, "cert")
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
local key = cursor:get(UCINAME, tlskey, "key")
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
local ciphers = cursor:get(UCINAME, tlskey, "ciphers")
if ciphers then
@@ -189,4 +194,4 @@ function prepare_tls(tlskey)
end
end
return tls
-end \ No newline at end of file
+end