Skip to content

Commit a787a22

Browse files
whutwhuzwoop
authored andcommitted
set sni_name with remapped origin name if sni_policy is not the default value (#6898)
Co-authored-by: xinli1 <xinli1@linkedin.com> (cherry picked from commit 6f564de)
1 parent 1ee1c0c commit a787a22

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

proxy/http/HttpSM.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4749,11 +4749,13 @@ HttpSM::get_outbound_sni() const
47494749
{
47504750
const char *sni_name = nullptr;
47514751
size_t len = 0;
4752-
if (t_state.txn_conf->ssl_client_sni_policy != nullptr && !strcmp(t_state.txn_conf->ssl_client_sni_policy, "remap")) {
4752+
if (t_state.txn_conf->ssl_client_sni_policy == nullptr || !strcmp(t_state.txn_conf->ssl_client_sni_policy, "host")) {
4753+
// By default the host header field value is used for the SNI.
4754+
sni_name = t_state.hdr_info.server_request.host_get(reinterpret_cast<int *>(&len));
4755+
} else {
4756+
// If other is specified, like "remap" and "verify_with_name_source", the remapped origin name is used for the SNI value
47534757
len = strlen(t_state.server_info.name);
47544758
sni_name = t_state.server_info.name;
4755-
} else { // Do the default of host header for SNI
4756-
sni_name = t_state.hdr_info.server_request.host_get(reinterpret_cast<int *>(&len));
47574759
}
47584760
return std::string_view(sni_name, len);
47594761
}

0 commit comments

Comments
 (0)