0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 23:40:57 +01:00

ircd::server: Set SNI explicitly here rather than through fallback.

ircd::server: Detect IP literal to set the peer::remote/open_opts directly.
This commit is contained in:
Jason Volk 2019-04-15 13:16:00 -07:00
parent 7d021f9430
commit b56df6677e

View file

@ -567,10 +567,21 @@ ircd::server::peer::peer(const net::hostport &hostport,
std::move(open_opts)
}
{
const net::hostport canon{this->hostcanon};
this->open_opts.hostport.host = net::host(canon);
this->open_opts.hostport.port = net::port(canon);
this->open_opts.hostport.service = this->service;
const net::hostport &canon{this->hostcanon};
this->open_opts.hostport.host = this->hostcanon; // Resolve SRV on this name.
this->open_opts.hostport.port = net::port(hostport);
this->open_opts.hostport.service = this->service; // Resolve SRV on this protocol.
this->open_opts.server_name = this->hostcanon; // Send SNI for this name.
this->open_opts.common_name = this->hostcanon; // Cert verify this name.
if(rfc3986::valid(std::nothrow, rfc3986::parser::ip_address, host(this->open_opts.hostport)))
this->remote =
{
host(this->open_opts.hostport), port(this->open_opts.hostport)
};
this->open_opts.ipport = this->remote;
}