diff options
author | Kim Alvefur <zash@zash.se> | 2012-12-28 15:14:11 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-12-28 15:14:11 +0100 |
commit | 45f6b0c64c3ab63603fe8bc8b29f2dbc835b4e92 (patch) | |
tree | 0203d6bd6df69296fe7defc78a44293a3e08767d /core | |
parent | 93fcefee1c694c8917be74879d4d204730904e07 (diff) | |
parent | 71f54b16f9bf4a2561f80058affb049850c90327 (diff) | |
download | prosody-45f6b0c64c3ab63603fe8bc8b29f2dbc835b4e92.tar.gz prosody-45f6b0c64c3ab63603fe8bc8b29f2dbc835b4e92.zip |
Merge 0.9->trunk
Diffstat (limited to 'core')
-rw-r--r-- | core/certmanager.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/certmanager.lua b/core/certmanager.lua index 20a6d609..a9f8b644 100644 --- a/core/certmanager.lua +++ b/core/certmanager.lua @@ -17,10 +17,11 @@ local prosody = prosody; local resolve_path = configmanager.resolve_relative_path; local config_path = prosody.paths.config; -local luasec_has_noticket; +local luasec_has_noticket, luasec_has_verifyext; if ssl then local luasec_major, luasec_minor = ssl._VERSION:match("^(%d+)%.(%d+)"); luasec_has_noticket = tonumber(luasec_major)>0 or tonumber(luasec_minor)>=4; + luasec_has_verifyext = tonumber(luasec_major)>0 or tonumber(luasec_minor)>=5; end module "certmanager" @@ -28,8 +29,16 @@ module "certmanager" -- Global SSL options if not overridden per-host local default_ssl_config = configmanager.get("*", "core", "ssl"); local default_capath = "/etc/ssl/certs"; -local default_verify = (ssl and ssl.x509 and { "peer", "client_once", "continue", "ignore_purpose" }) or "none"; +local default_verify = (ssl and ssl.x509 and { "peer", "client_once", }) or "none"; local default_options = { "no_sslv2", luasec_has_noticket and "no_ticket" or nil }; +local default_verifyext = { "lsec_continue", "lsec_ignore_purpose" }; + +if not luasec_has_verifyext and ssl.x509 then + -- COMPAT mw/luasec-hg + for i=1,#default_verifyext do -- Remove lsec_ prefix + default_verify[#default_verify+1] = default_verifyext[i]:sub(6); + end +end function create_context(host, mode, user_ssl_config) user_ssl_config = user_ssl_config or default_ssl_config; @@ -46,6 +55,7 @@ function create_context(host, mode, user_ssl_config) capath = resolve_path(config_path, user_ssl_config.capath or default_capath); cafile = resolve_path(config_path, user_ssl_config.cafile); verify = user_ssl_config.verify or default_verify; + verifyext = user_ssl_config.verifyext or default_verifyext; options = user_ssl_config.options or default_options; depth = user_ssl_config.depth; }; |