Mercurial > prosody-hg
comparison core/certmanager.lua @ 6073:4a1fdd72e98a
certmanager: Check for non-nil values instead of true-ish values, allows removing defaults
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 14 Apr 2014 23:00:44 +0200 |
| parents | dd11480ecd47 |
| children | 6498554adb0d |
comparison
equal
deleted
inserted
replaced
| 6071:420c0d3b8583 | 6073:4a1fdd72e98a |
|---|---|
| 67 | 67 |
| 68 if not ssl then return nil, "LuaSec (required for encryption) was not found"; end | 68 if not ssl then return nil, "LuaSec (required for encryption) was not found"; end |
| 69 | 69 |
| 70 if global_ssl_config then | 70 if global_ssl_config then |
| 71 for option,default_value in pairs(global_ssl_config) do | 71 for option,default_value in pairs(global_ssl_config) do |
| 72 if not user_ssl_config[option] then | 72 if user_ssl_config[option] == nil then |
| 73 user_ssl_config[option] = default_value; | 73 user_ssl_config[option] = default_value; |
| 74 end | 74 end |
| 75 end | 75 end |
| 76 end | 76 end |
| 77 | |
| 77 for option,default_value in pairs(core_defaults) do | 78 for option,default_value in pairs(core_defaults) do |
| 78 if not user_ssl_config[option] then | 79 if user_ssl_config[option] == nil then |
| 79 user_ssl_config[option] = default_value; | 80 user_ssl_config[option] = default_value; |
| 80 end | 81 end |
| 81 end | 82 end |
| 82 user_ssl_config.password = user_ssl_config.password or function() log("error", "Encrypted certificate for %s requires 'ssl' 'password' to be set in config", host); end; | 83 user_ssl_config.password = user_ssl_config.password or function() log("error", "Encrypted certificate for %s requires 'ssl' 'password' to be set in config", host); end; |
| 83 for option in pairs(path_options) do | 84 for option in pairs(path_options) do |
