| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/socket/ssl_client_socket_pool.h" | 5 #include "net/socket/ssl_client_socket_pool.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 if (params_->expect_spdy() && | 359 if (params_->expect_spdy() && |
| 360 ssl_socket_->GetNegotiatedProtocol() != kProtoHTTP2) { | 360 ssl_socket_->GetNegotiatedProtocol() != kProtoHTTP2) { |
| 361 return ERR_ALPN_NEGOTIATION_FAILED; | 361 return ERR_ALPN_NEGOTIATION_FAILED; |
| 362 } | 362 } |
| 363 | 363 |
| 364 // Perform a TLS 1.3 version interference probe on various connection | 364 // Perform a TLS 1.3 version interference probe on various connection |
| 365 // errors. The retry will never produce a successful connection but may map | 365 // errors. The retry will never produce a successful connection but may map |
| 366 // errors to ERR_SSL_VERSION_INTERFERENCE, which signals a probable | 366 // errors to ERR_SSL_VERSION_INTERFERENCE, which signals a probable |
| 367 // version-interfering middlebox. | 367 // version-interfering middlebox. |
| 368 if (params_->ssl_config().version_max == SSL_PROTOCOL_VERSION_TLS1_3 && | 368 if (params_->ssl_config().version_max == SSL_PROTOCOL_VERSION_TLS1_3 && |
| 369 !params_->ssl_config().deprecated_cipher_suites_enabled && | |
| 370 !version_interference_probe_) { | 369 !version_interference_probe_) { |
| 371 if (result == ERR_CONNECTION_CLOSED || result == ERR_SSL_PROTOCOL_ERROR || | 370 if (result == ERR_CONNECTION_CLOSED || result == ERR_SSL_PROTOCOL_ERROR || |
| 372 result == ERR_SSL_VERSION_OR_CIPHER_MISMATCH || | 371 result == ERR_SSL_VERSION_OR_CIPHER_MISMATCH || |
| 373 result == ERR_CONNECTION_RESET || | 372 result == ERR_CONNECTION_RESET || |
| 374 result == ERR_SSL_BAD_RECORD_MAC_ALERT) { | 373 result == ERR_SSL_BAD_RECORD_MAC_ALERT) { |
| 375 // Report the error code for each time a version interference probe is | 374 // Report the error code for each time a version interference probe is |
| 376 // triggered. | 375 // triggered. |
| 377 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLVersionInterferenceProbeTrigger", | 376 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLVersionInterferenceProbeTrigger", |
| 378 std::abs(result)); | 377 std::abs(result)); |
| 379 net_log().AddEventWithNetErrorCode( | 378 net_log().AddEventWithNetErrorCode( |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 if (base_.CloseOneIdleSocket()) | 758 if (base_.CloseOneIdleSocket()) |
| 760 return true; | 759 return true; |
| 761 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 760 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
| 762 } | 761 } |
| 763 | 762 |
| 764 void SSLClientSocketPool::OnSSLConfigChanged() { | 763 void SSLClientSocketPool::OnSSLConfigChanged() { |
| 765 FlushWithError(ERR_NETWORK_CHANGED); | 764 FlushWithError(ERR_NETWORK_CHANGED); |
| 766 } | 765 } |
| 767 | 766 |
| 768 } // namespace net | 767 } // namespace net |
| OLD | NEW |