0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-04 21:08:57 +01:00

modules/s_listen: Remove requirement for tmp-dh; handle missing file error.

This commit is contained in:
Jason Volk 2018-08-29 16:20:21 -07:00
parent 72f77b6d22
commit 52b01b62dd

View file

@ -110,18 +110,20 @@ init_listener(const m::event &event)
void
init_listener(const string_view &name,
const json::object &opts)
try
{
if(!opts.has("tmp_dh_path"))
throw user_error
{
"Listener %s requires a 'tmp_dh_path' in the config. We do not"
" create this yet. Try `openssl dhparam -outform PEM -out dh512.pem 512`",
name
};
listeners.emplace_back(name, opts, []
(const auto &sock)
{
ircd::add_client(sock);
});
}
catch(const std::exception &e)
{
log::error
{
"Failed to init listener '%s' :%s",
name,
e.what()
};
}