ircd::net::acceptor: Move alpn/sni init config into method; minor reorg.

This commit is contained in:
Jason Volk 2023-03-18 11:10:34 -07:00
parent abf1ed47c6
commit 3fcfaddc3e
2 changed files with 12 additions and 7 deletions

View File

@ -71,6 +71,7 @@ ircd::net::acceptor
void configure_ciphers(const json::object &);
void configure_flags(const json::object &);
void configure_password(const json::object &);
void configure_sni(const json::object &);
void configure(const json::object &opts);
// Handshake stack

View File

@ -328,13 +328,6 @@ try
}
{
configure(opts);
log::debug
{
log, "%s configured listener SSL",
loghead(*this)
};
open();
}
catch(const boost::system::system_error &e)
@ -1081,7 +1074,18 @@ ircd::net::acceptor::configure(const json::object &opts)
configure_ciphers(opts);
configure_curves(opts);
configure_certs(opts);
configure_sni(opts);
log::debug
{
log, "%s configured listener SSL",
loghead(*this)
};
}
void
ircd::net::acceptor::configure_sni(const json::object &opts)
{
SSL_CTX_set_alpn_select_cb(ssl.native_handle(), ircd_net_acceptor_handle_alpn, this);
SSL_CTX_set_tlsext_servername_callback(ssl.native_handle(), ircd_net_acceptor_handle_sni);
SSL_CTX_set_tlsext_servername_arg(ssl.native_handle(), this);