Comparison

net/server.lua @ 12481:2ee27587fec7

net: refactor sslconfig to not depend on LuaSec This now requires that the network backend exposes a tls_builder function, which essentially wraps the former util.sslconfig.new() function, passing a factory to create the eventual SSL context. That allows a net.server backend to pick whatever it likes as SSL context factory, as long as it understands the config table passed by the SSL config builder. Heck, a backend could even mock and replace the entire SSL config builder API.
author Jonas Schäfer <jonas@wielicki.name>
date Sat, 02 Apr 2022 11:15:33 +0200
parent 11764:e2650d59db2d
child 12974:ba409c67353b
comparison
equal deleted inserted replaced
12480:7e9ebdc75ce4 12481:2ee27587fec7
116 end 116 end
117 load_config(); 117 load_config();
118 prosody.events.add_handler("config-reloaded", load_config); 118 prosody.events.add_handler("config-reloaded", load_config);
119 end 119 end
120 120
121 local tls_builder = server.tls_builder;
122 -- resolving the basedir here avoids util.sslconfig depending on
123 -- prosody.paths.config
124 function server.tls_builder()
125 return tls_builder(prosody.paths.config or "")
126 end
127
121 -- require "net.server" shall now forever return this, 128 -- require "net.server" shall now forever return this,
122 -- ie. server_select or server_event as chosen above. 129 -- ie. server_select or server_event as chosen above.
123 return server; 130 return server;