# HG changeset patch # User Kim Alvefur # Date 1423145675 -3600 # Node ID ffc0a57889aa0b35be246fc1f08e4e36733a770d # Parent bcf32653cab7d3ddb6e250204fe7f452fe61b9fa certmanager: Add locals for ssl.context and ssl.x509 diff -r bcf32653cab7 -r ffc0a57889aa core/certmanager.lua --- a/core/certmanager.lua Thu Feb 05 15:10:23 2015 +0100 +++ b/core/certmanager.lua Thu Feb 05 15:14:35 2015 +0100 @@ -19,6 +19,8 @@ local configmanager = require "core.configmanager"; local log = require "util.logger".init("certmanager"); +local ssl_context = ssl.context or softreq"ssl.context"; +local ssl_x509 = ssl.x509 or softreq"ssl.x509"; local ssl_newcontext = ssl.newcontext; local new_config = require"util.sslconfig".new; @@ -47,7 +49,7 @@ local core_defaults = { capath = "/etc/ssl/certs"; protocol = "tlsv1+"; - verify = (ssl.x509 and { "peer", "client_once", }) or "none"; + verify = (ssl_x509 and { "peer", "client_once", }) or "none"; options = { cipher_server_preference = true; no_ticket = luasec_has_noticket; @@ -64,7 +66,7 @@ key = true, certificate = true, cafile = true, capath = true, dhparam = true } -if not luasec_has_verifyext and ssl.x509 then +if not luasec_has_verifyext and ssl_x509 then -- COMPAT mw/luasec-hg for i=1,#core_defaults.verifyext do -- Remove lsec_ prefix core_defaults.verify[#core_defaults.verify+1] = core_defaults.verifyext[i]:sub(6); @@ -114,7 +116,7 @@ -- of it ourselves (W/A for #x) if ctx and user_ssl_config.ciphers then local success; - success, err = ssl.context.setcipher(ctx, user_ssl_config.ciphers); + success, err = ssl_context.setcipher(ctx, user_ssl_config.ciphers); if not success then ctx = nil; end end