Skip to content

Commit

Permalink
tool: print client's SNI value, if any.
Browse files Browse the repository at this point in the history
Change-Id: I4fbce046090f0b0e78c9de923643268cfe6f142f
Reviewed-on: https://boringssl-review.googlesource.com/12241
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
  • Loading branch information
ghedo authored and CQ bot account: commit-bot@chromium.org committed Nov 16, 2016
1 parent 4008c7a commit 8d3f130
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tool/transport_common.cc
Expand Up @@ -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<X509> peer(SSL_get_peer_certificate(ssl));
if (peer != nullptr) {
Expand Down

0 comments on commit 8d3f130

Please sign in to comment.