diff options
author | davidben <davidben@chromium.org> | 2016-03-11 17:40:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-12 01:42:03 +0000 |
commit | 6e50b9f54970b1527162fba5611b8d1b41a9d9ba (patch) | |
tree | 467c1a3b9f817a520ca0c5b62355213fe45edd7c /net | |
parent | 51328f113889a8562fd9ea3fd5f92305337db6d2 (diff) | |
download | chromium_src-6e50b9f54970b1527162fba5611b8d1b41a9d9ba.zip chromium_src-6e50b9f54970b1527162fba5611b8d1b41a9d9ba.tar.gz chromium_src-6e50b9f54970b1527162fba5611b8d1b41a9d9ba.tar.bz2 |
Add histograms to track down the cause of ERR_SSL_PROTOCOL_ERROR.
These histograms will be removed when the bug is resolved (or really as soon
as we get data back, so hopefully Monday...). Notably, they record BoringSSL
error reasons which are *not* stable.
The intent of these histograms is to:
- Determine what BoringSSL error is triggering these.
- Based on magnitudes, confirm this is coming from Read/Write and not Connect.
- See if there is a correlation with some cipher suite by comparing the
distribution with the normal cipher suite distribution.
BUG=593963
Review URL: https://codereview.chromium.org/1786593003
Cr-Commit-Position: refs/heads/master@{#380827}
Diffstat (limited to 'net')
-rw-r--r-- | net/socket/ssl_client_socket_openssl.cc | 32 | ||||
-rw-r--r-- | net/socket/ssl_client_socket_openssl.h | 2 |
2 files changed, 34 insertions, 0 deletions
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc index a98b815..15531d0 100644 --- a/net/socket/ssl_client_socket_openssl.cc +++ b/net/socket/ssl_client_socket_openssl.cc @@ -1083,6 +1083,13 @@ bool SSLClientSocketOpenSSL::DoTransportIO() { return network_moved; } +uint16_t SSLClientSocketOpenSSL::GetCipherSuite() { + const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl_); + if (!cipher) + return 0; + return static_cast<uint16_t>(SSL_CIPHER_get_id(cipher)); +} + // TODO(cbentzel): Remove including "base/threading/thread_local.h" and // g_first_run_completed once crbug.com/424386 is fixed. base::LazyInstance<base::ThreadLocalBoolean>::Leaky g_first_run_completed = @@ -1169,6 +1176,14 @@ int SSLClientSocketOpenSSL::DoHandshake() { } else { ssl_failure_state_ = SSL_FAILURE_UNKNOWN; } + + // TODO(davidben): Remove this once https://crbug.com/593963 is resolved. + if (net_error == ERR_SSL_PROTOCOL_ERROR) { + UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolErrorCipher.Connect", + GetCipherSuite()); + UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolErrorReason.Connect", + ERR_GET_REASON(error_info.error_code)); + } } GotoState(STATE_HANDSHAKE_COMPLETE); @@ -1647,6 +1662,15 @@ int SSLClientSocketOpenSSL::DoPayloadRead() { net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_RECEIVED, rv, user_read_buf_->data()); } else if (rv != ERR_IO_PENDING) { + // TODO(davidben): Remove this once https://crbug.com/593963 is resolved. + if (rv == ERR_SSL_PROTOCOL_ERROR) { + UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolErrorCipher.Read", + GetCipherSuite()); + UMA_HISTOGRAM_SPARSE_SLOWLY( + "Net.SSLProtocolErrorReason.Read", + ERR_GET_REASON(pending_read_error_info_.error_code)); + } + net_log_.AddEvent( NetLog::TYPE_SSL_READ_ERROR, CreateNetLogOpenSSLErrorCallback(rv, pending_read_ssl_error_, @@ -1675,6 +1699,14 @@ int SSLClientSocketOpenSSL::DoPayloadWrite() { &error_info); if (net_error != ERR_IO_PENDING) { + // TODO(davidben): Remove this once https://crbug.com/593963 is resolved. + if (net_error == ERR_SSL_PROTOCOL_ERROR) { + UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolErrorCipher.Write", + GetCipherSuite()); + UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolErrorReason.Write", + ERR_GET_REASON(error_info.error_code)); + } + net_log_.AddEvent( NetLog::TYPE_SSL_WRITE_ERROR, CreateNetLogOpenSSLErrorCallback(net_error, ssl_error, error_info)); diff --git a/net/socket/ssl_client_socket_openssl.h b/net/socket/ssl_client_socket_openssl.h index d1078a9..bf286e6 100644 --- a/net/socket/ssl_client_socket_openssl.h +++ b/net/socket/ssl_client_socket_openssl.h @@ -127,6 +127,8 @@ class SSLClientSocketOpenSSL : public SSLClientSocket { void DoReadCallback(int result); void DoWriteCallback(int result); + uint16_t GetCipherSuite(); + bool DoTransportIO(); int DoHandshake(); int DoHandshakeComplete(int result); |