mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
ircd::openssl: Interface to set server name indication for client hello.
This commit is contained in:
parent
fee9222e70
commit
59f63841ba
2 changed files with 10 additions and 0 deletions
|
@ -140,6 +140,7 @@ namespace ircd::openssl
|
|||
|
||||
// SNI suite
|
||||
string_view server_name(const SSL &); // provided by client
|
||||
void server_name(SSL &, const string_view &); // set by client
|
||||
}
|
||||
|
||||
/// OpenSSL BIO convenience utils and wraps; also secure file IO closures
|
||||
|
|
|
@ -52,6 +52,15 @@ namespace ircd::openssl
|
|||
// SNI
|
||||
//
|
||||
|
||||
void
|
||||
ircd::openssl::server_name(SSL &ssl,
|
||||
const string_view &name)
|
||||
{
|
||||
thread_local char buf[256];
|
||||
strlcpy(buf, name);
|
||||
call(::SSL_ctrl, &ssl, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, buf);
|
||||
}
|
||||
|
||||
ircd::string_view
|
||||
ircd::openssl::server_name(const SSL &ssl)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue