Commit 69a4f3bf authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttp: Consider :authority custom header field for SNI

parent 5334cb5a
...@@ -531,12 +531,13 @@ int HttpClient::initiate_connection() { ...@@ -531,12 +531,13 @@ int HttpClient::initiate_connection() {
SSL_set_fd(ssl, fd); SSL_set_fd(ssl, fd);
SSL_set_connect_state(ssl); SSL_set_connect_state(ssl);
// If the user overrode the host header, use that value for // If the user overrode the :authority or host header, use that
// the SNI extension // value for the SNI extension
const char *host_string = nullptr; const char *host_string = nullptr;
auto i = auto i = std::find_if(std::begin(config.headers),
std::find_if(std::begin(config.headers), std::end(config.headers), std::end(config.headers), [](const Header &nv) {
[](const Header &nv) { return "host" == nv.name; }); return ":authority" == nv.name || "host" == nv.name;
});
if (i != std::end(config.headers)) { if (i != std::end(config.headers)) {
host_string = (*i).value.c_str(); host_string = (*i).value.c_str();
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment