From 7d02b33af5856ac70f06b0c0e2d58ed2c705394e Mon Sep 17 00:00:00 2001 From: "Christopher M. Luciano" Date: Tue, 28 Aug 2018 12:19:05 -0400 Subject: [PATCH] Add SNI access_logging to http Signed-off-by: Christopher M. Luciano --- docs/root/configuration/access_log.rst | 2 ++ docs/root/intro/version_history.rst | 2 +- source/common/http/conn_manager_impl.cc | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/root/configuration/access_log.rst b/docs/root/configuration/access_log.rst index eca982d73b50..323b5f1b712d 100644 --- a/docs/root/configuration/access_log.rst +++ b/docs/root/configuration/access_log.rst @@ -228,6 +228,8 @@ The following command operators are supported: Not implemented ("-"). %REQUESTED_SERVER_NAME% + HTTP + String value set on ssl connection socket for Server Name Indication (SNI) TCP String value set on ssl connection socket for Server Name Indication (SNI) diff --git a/docs/root/intro/version_history.rst b/docs/root/intro/version_history.rst index 95a487cc3743..e88b5313d057 100644 --- a/docs/root/intro/version_history.rst +++ b/docs/root/intro/version_history.rst @@ -6,7 +6,7 @@ Version history * access log: added :ref:`response flag filter ` to filter based on the presence of Envoy response flags. * access log: added RESPONSE_DURATION and RESPONSE_TX_DURATION. -* access log: added REQUESTED_SERVER_NAME for SNI +* access log: added REQUESTED_SERVER_NAME for SNI to tcp_proxy and http * admin: added :http:get:`/hystrix_event_stream` as an endpoint for monitoring envoy's statistics through `Hystrix dashboard `_. * grpc-json: added support for building HTTP response from diff --git a/source/common/http/conn_manager_impl.cc b/source/common/http/conn_manager_impl.cc index 6e27c7f6baaf..009b289aea71 100644 --- a/source/common/http/conn_manager_impl.cc +++ b/source/common/http/conn_manager_impl.cc @@ -380,6 +380,8 @@ ConnectionManagerImpl::ActiveStream::ActiveStream(ConnectionManagerImpl& connect [this]() -> void { onIdleTimeout(); }); resetIdleTimer(); } + request_info_.setRequestedServerName( + connection_manager_.read_callbacks_->connection().requestedServerName()); } ConnectionManagerImpl::ActiveStream::~ActiveStream() {