You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by su...@apache.org on 2020/06/16 01:59:59 UTC
[trafficserver] branch master updated: set sni_name with remapped
origin name if sni_policy is not the default value (#6898)
This is an automated email from the ASF dual-hosted git repository.
sudheerv pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 6f564de set sni_name with remapped origin name if sni_policy is not the default value (#6898)
6f564de is described below
commit 6f564de71cda287b5b79b89d1c8c327a24ba5472
Author: Xin Li <33...@users.noreply.github.com>
AuthorDate: Mon Jun 15 18:59:49 2020 -0700
set sni_name with remapped origin name if sni_policy is not the default value (#6898)
Co-authored-by: xinli1 <xi...@linkedin.com>
---
proxy/http/HttpSM.cc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 4c308b6..96c6b32 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -4800,11 +4800,13 @@ HttpSM::get_outbound_sni() const
{
const char *sni_name = nullptr;
size_t len = 0;
- if (t_state.txn_conf->ssl_client_sni_policy != nullptr && !strcmp(t_state.txn_conf->ssl_client_sni_policy, "remap")) {
+ if (t_state.txn_conf->ssl_client_sni_policy == nullptr || !strcmp(t_state.txn_conf->ssl_client_sni_policy, "host")) {
+ // By default the host header field value is used for the SNI.
+ sni_name = t_state.hdr_info.server_request.host_get(reinterpret_cast<int *>(&len));
+ } else {
+ // If other is specified, like "remap" and "verify_with_name_source", the remapped origin name is used for the SNI value
len = strlen(t_state.server_info.name);
sni_name = t_state.server_info.name;
- } else { // Do the default of host header for SNI
- sni_name = t_state.hdr_info.server_request.host_get(reinterpret_cast<int *>(&len));
}
return std::string_view(sni_name, len);
}