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:
parent
7d021f9430
commit
b56df6677e
1 changed files with 15 additions and 4 deletions
|
@ -567,10 +567,21 @@ ircd::server::peer::peer(const net::hostport &hostport,
|
||||||
std::move(open_opts)
|
std::move(open_opts)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const net::hostport canon{this->hostcanon};
|
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.host = this->hostcanon; // Resolve SRV on this name.
|
||||||
this->open_opts.hostport.service = this->service;
|
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;
|
this->open_opts.ipport = this->remote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue