tool: print client's SNI value, if any.

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>
This commit is contained in:
Alessandro Ghedini 2016-11-14 21:24:18 +00:00 committed by CQ bot account: commit-bot@chromium.org
parent 4008c7a80d
commit 8d3f130c55

View File

@ -267,6 +267,11 @@ void PrintConnectionInfo(const SSL *ssl) {
SSL_get0_alpn_selected(ssl, &alpn, &alpn_len); SSL_get0_alpn_selected(ssl, &alpn, &alpn_len);
fprintf(stderr, " ALPN protocol: %.*s\n", alpn_len, alpn); 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. // Print the server cert subject and issuer names.
bssl::UniquePtr<X509> peer(SSL_get_peer_certificate(ssl)); bssl::UniquePtr<X509> peer(SSL_get_peer_certificate(ssl));
if (peer != nullptr) { if (peer != nullptr) {