Software /
code /
prosody
Comparison
core/certmanager.lua @ 5656:576488cffc3a
certmanager: Complain if key or certificate is missing from SSL config.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 07 Jun 2013 20:55:02 +0200 |
parent | 5621:63cfd59999b6 |
child | 5674:ebdbf4cf0b2f |
comparison
equal
deleted
inserted
replaced
5655:6d7f7548b2c9 | 5656:576488cffc3a |
---|---|
47 function create_context(host, mode, user_ssl_config) | 47 function create_context(host, mode, user_ssl_config) |
48 user_ssl_config = user_ssl_config or default_ssl_config; | 48 user_ssl_config = user_ssl_config or default_ssl_config; |
49 | 49 |
50 if not ssl then return nil, "LuaSec (required for encryption) was not found"; end | 50 if not ssl then return nil, "LuaSec (required for encryption) was not found"; end |
51 if not user_ssl_config then return nil, "No SSL/TLS configuration present for "..host; end | 51 if not user_ssl_config then return nil, "No SSL/TLS configuration present for "..host; end |
52 if not user_ssl_config.key then return nil, "No key present in SSL/TLS configuration for "..host; end | |
53 if not user_ssl_config.certificate then return nil, "No certificate present in SSL/TLS configuration for "..host; end | |
52 | 54 |
53 local ssl_config = { | 55 local ssl_config = { |
54 mode = mode; | 56 mode = mode; |
55 protocol = user_ssl_config.protocol or "sslv23"; | 57 protocol = user_ssl_config.protocol or "sslv23"; |
56 key = resolve_path(config_path, user_ssl_config.key); | 58 key = resolve_path(config_path, user_ssl_config.key); |