Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions iocore/net/I_NetVConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,12 @@ class NetVConnection : public VConnection, public PluginUserArgs<TS_USER_ARGS_VC
return false;
}

virtual const char *
get_sni_servername() const
{
return nullptr;
}

/** Structure holding user options. */
NetVCOptions options;

Expand Down
6 changes: 6 additions & 0 deletions iocore/net/P_SSLNetVConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,12 @@ class SSLNetVConnection : public UnixNetVConnection, public ALPNSupport
verify_cert = ctx;
}

const char *
get_sni_servername() const override
{
return SSL_get_servername(this->ssl, TLSEXT_NAMETYPE_host_name);
}

private:
std::string_view map_tls_protocol_to_tag(const char *proto_string) const;
bool update_rbio(bool move_to_socket);
Expand Down
4 changes: 2 additions & 2 deletions proxy/http/HttpSessionManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ServerSessionPool::validate_host_sni(HttpSM *sm, NetVConnection *netvc)
// by fetching the hostname from the server request. So the connection should only
// be reused if the hostname in the new request is the same as the host name in the
// original request
const char *session_sni = netvc->options.sni_servername;
const char *session_sni = netvc->get_sni_servername();
if (session_sni) {
// TS-4468: If the connection matches, make sure the SNI server
// name (if present) matches the request hostname
Expand All @@ -106,7 +106,7 @@ ServerSessionPool::validate_sni(HttpSM *sm, NetVConnection *netvc)
// a new connection.
//
if (sm->t_state.scheme == URL_WKSIDX_HTTPS) {
const char *session_sni = netvc->options.sni_servername;
const char *session_sni = netvc->get_sni_servername();
std::string_view proposed_sni = sm->get_outbound_sni();
Debug("http_ss", "validate_sni proposed_sni=%s, sni=%s", proposed_sni.data(), session_sni);
if (!session_sni || proposed_sni.length() == 0) {
Expand Down