Comparison

core/certmanager.lua @ 6075:524060125f9c

certmanager: Concatenate cipher list if given as a table
author Kim Alvefur <zash@zash.se>
date Mon, 14 Apr 2014 23:34:35 +0200
parent 6074:6498554adb0d
child 6076:e0713386319a
comparison
equal deleted inserted replaced
6074:6498554adb0d 6075:524060125f9c
13 13
14 local tostring = tostring; 14 local tostring = tostring;
15 local pairs = pairs; 15 local pairs = pairs;
16 local type = type; 16 local type = type;
17 local io_open = io.open; 17 local io_open = io.open;
18 local t_concat = table.concat;
18 19
19 local prosody = prosody; 20 local prosody = prosody;
20 local resolve_path = configmanager.resolve_relative_path; 21 local resolve_path = configmanager.resolve_relative_path;
21 local config_path = prosody.paths.config; 22 local config_path = prosody.paths.config;
22 23
85 if type(user_ssl_config[option]) == "string" then 86 if type(user_ssl_config[option]) == "string" then
86 user_ssl_config[option] = resolve_path(config_path, user_ssl_config[option]); 87 user_ssl_config[option] = resolve_path(config_path, user_ssl_config[option]);
87 end 88 end
88 end 89 end
89 90
91 -- Allow the cipher list to be a table
92 if type(user_ssl_config.ciphers) == "table" then
93 user_ssl_config.ciphers = t_concat(user_ssl_config.ciphers, ":")
94 end
95
90 if mode == "server" then 96 if mode == "server" then
91 if not user_ssl_config.key then return nil, "No key present in SSL/TLS configuration for "..host; end 97 if not user_ssl_config.key then return nil, "No key present in SSL/TLS configuration for "..host; end
92 if not user_ssl_config.certificate then return nil, "No certificate present in SSL/TLS configuration for "..host; end 98 if not user_ssl_config.certificate then return nil, "No certificate present in SSL/TLS configuration for "..host; end
93 end 99 end
94 100