From 8d3f130c557fd69ccb241ff781583dedad085542 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Mon, 14 Nov 2016 21:24:18 +0000 Subject: [PATCH] tool: print client's SNI value, if any. Change-Id: I4fbce046090f0b0e78c9de923643268cfe6f142f Reviewed-on: https://boringssl-review.googlesource.com/12241 Reviewed-by: Adam Langley Commit-Queue: Adam Langley CQ-Verified: CQ bot account: commit-bot@chromium.org --- tool/transport_common.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tool/transport_common.cc b/tool/transport_common.cc index 745e8dfc..7eed8ba4 100644 --- a/tool/transport_common.cc +++ b/tool/transport_common.cc @@ -267,6 +267,11 @@ void PrintConnectionInfo(const SSL *ssl) { SSL_get0_alpn_selected(ssl, &alpn, &alpn_len); fprintf(stderr, " ALPN protocol: %.*s\n", alpn_len, alpn); + const char *host_name = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name); + if (host_name != nullptr && SSL_is_server(ssl)) { + fprintf(stderr, " Client sent SNI: %s\n", host_name); + } + // Print the server cert subject and issuer names. bssl::UniquePtr peer(SSL_get_peer_certificate(ssl)); if (peer != nullptr) {