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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 session->http_server_properties(), | 102 session->http_server_properties(), |
103 alternate_protocol_values, | 103 alternate_protocol_values, |
104 http_host_port_pair, | 104 http_host_port_pair, |
105 *session); | 105 *session); |
106 } | 106 } |
107 | 107 |
108 scoped_ptr<base::Value> NetLogSSLVersionFallbackCallback( | 108 scoped_ptr<base::Value> NetLogSSLVersionFallbackCallback( |
109 const GURL* url, | 109 const GURL* url, |
110 int net_error, | 110 int net_error, |
111 SSLFailureState ssl_failure_state, | 111 SSLFailureState ssl_failure_state, |
112 uint16 version_before, | 112 uint16_t version_before, |
113 uint16 version_after, | 113 uint16_t version_after, |
114 NetLogCaptureMode /* capture_mode */) { | 114 NetLogCaptureMode /* capture_mode */) { |
115 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 115 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
116 dict->SetString("host_and_port", GetHostAndPort(*url)); | 116 dict->SetString("host_and_port", GetHostAndPort(*url)); |
117 dict->SetInteger("net_error", net_error); | 117 dict->SetInteger("net_error", net_error); |
118 dict->SetInteger("ssl_failure_state", ssl_failure_state); | 118 dict->SetInteger("ssl_failure_state", ssl_failure_state); |
119 dict->SetInteger("version_before", version_before); | 119 dict->SetInteger("version_before", version_before); |
120 dict->SetInteger("version_after", version_after); | 120 dict->SetInteger("version_after", version_after); |
121 return dict.Pass(); | 121 return dict.Pass(); |
122 } | 122 } |
123 | 123 |
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 error == ERR_CONNECTION_CLOSED || error == ERR_CONNECTION_RESET)) { | 1316 error == ERR_CONNECTION_CLOSED || error == ERR_CONNECTION_RESET)) { |
1317 net_log_.AddEvent( | 1317 net_log_.AddEvent( |
1318 NetLog::TYPE_SSL_CIPHER_FALLBACK, | 1318 NetLog::TYPE_SSL_CIPHER_FALLBACK, |
1319 base::Bind(&NetLogSSLCipherFallbackCallback, &request_->url, error)); | 1319 base::Bind(&NetLogSSLCipherFallbackCallback, &request_->url, error)); |
1320 server_ssl_config_.deprecated_cipher_suites_enabled = true; | 1320 server_ssl_config_.deprecated_cipher_suites_enabled = true; |
1321 ResetConnectionAndRequestForResend(); | 1321 ResetConnectionAndRequestForResend(); |
1322 return OK; | 1322 return OK; |
1323 } | 1323 } |
1324 | 1324 |
1325 bool should_fallback = false; | 1325 bool should_fallback = false; |
1326 uint16 version_max = server_ssl_config_.version_max; | 1326 uint16_t version_max = server_ssl_config_.version_max; |
1327 | 1327 |
1328 switch (error) { | 1328 switch (error) { |
1329 case ERR_CONNECTION_CLOSED: | 1329 case ERR_CONNECTION_CLOSED: |
1330 case ERR_SSL_PROTOCOL_ERROR: | 1330 case ERR_SSL_PROTOCOL_ERROR: |
1331 case ERR_SSL_VERSION_OR_CIPHER_MISMATCH: | 1331 case ERR_SSL_VERSION_OR_CIPHER_MISMATCH: |
1332 if (version_max >= SSL_PROTOCOL_VERSION_TLS1 && | 1332 if (version_max >= SSL_PROTOCOL_VERSION_TLS1 && |
1333 version_max > server_ssl_config_.version_min) { | 1333 version_max > server_ssl_config_.version_min) { |
1334 // This could be a TLS-intolerant server or a server that chose a | 1334 // This could be a TLS-intolerant server or a server that chose a |
1335 // cipher suite defined only for higher protocol versions (such as | 1335 // cipher suite defined only for higher protocol versions (such as |
1336 // an SSL 3.0 server that chose a TLS-only cipher suite). Fall | 1336 // an SSL 3.0 server that chose a TLS-only cipher suite). Fall |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1701 DCHECK(stream_request_); | 1701 DCHECK(stream_request_); |
1702 | 1702 |
1703 // Since the transaction can restart with auth credentials, it may create a | 1703 // Since the transaction can restart with auth credentials, it may create a |
1704 // stream more than once. Accumulate all of the connection attempts across | 1704 // stream more than once. Accumulate all of the connection attempts across |
1705 // those streams by appending them to the vector: | 1705 // those streams by appending them to the vector: |
1706 for (const auto& attempt : stream_request_->connection_attempts()) | 1706 for (const auto& attempt : stream_request_->connection_attempts()) |
1707 connection_attempts_.push_back(attempt); | 1707 connection_attempts_.push_back(attempt); |
1708 } | 1708 } |
1709 | 1709 |
1710 } // namespace net | 1710 } // namespace net |
OLD | NEW |