| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/field_trial.h" | 9 #include "base/field_trial.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 | 1371 |
| 1372 if (error != OK) { | 1372 if (error != OK) { |
| 1373 SSLClientSocket* ssl_socket = | 1373 SSLClientSocket* ssl_socket = |
| 1374 reinterpret_cast<SSLClientSocket*>(connection_.socket()); | 1374 reinterpret_cast<SSLClientSocket*>(connection_.socket()); |
| 1375 ssl_socket->GetSSLInfo(&response_.ssl_info); | 1375 ssl_socket->GetSSLInfo(&response_.ssl_info); |
| 1376 | 1376 |
| 1377 // Add the bad certificate to the set of allowed certificates in the | 1377 // Add the bad certificate to the set of allowed certificates in the |
| 1378 // SSL info object. This data structure will be consulted after calling | 1378 // SSL info object. This data structure will be consulted after calling |
| 1379 // RestartIgnoringLastError(). And the user will be asked interactively | 1379 // RestartIgnoringLastError(). And the user will be asked interactively |
| 1380 // before RestartIgnoringLastError() is ever called. | 1380 // before RestartIgnoringLastError() is ever called. |
| 1381 ssl_config_.allowed_bad_certs_.insert(response_.ssl_info.cert); | 1381 SSLConfig::CertAndStatus bad_cert; |
| 1382 bad_cert.cert = response_.ssl_info.cert; |
| 1383 bad_cert.cert_status = response_.ssl_info.cert_status; |
| 1384 ssl_config_.allowed_bad_certs.push_back(bad_cert); |
| 1382 } | 1385 } |
| 1383 return error; | 1386 return error; |
| 1384 } | 1387 } |
| 1385 | 1388 |
| 1386 int HttpNetworkTransaction::HandleCertificateRequest(int error) { | 1389 int HttpNetworkTransaction::HandleCertificateRequest(int error) { |
| 1387 // Assert that the socket did not send a client certificate. | 1390 // Assert that the socket did not send a client certificate. |
| 1388 // Note: If we got a reused socket, it was created with some other | 1391 // Note: If we got a reused socket, it was created with some other |
| 1389 // transaction's ssl_config_, so we need to disable this assertion. We can | 1392 // transaction's ssl_config_, so we need to disable this assertion. We can |
| 1390 // get a certificate request on a reused socket when the server requested | 1393 // get a certificate request on a reused socket when the server requested |
| 1391 // renegotiation (rehandshake). | 1394 // renegotiation (rehandshake). |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 host_and_port = proxy_info_.proxy_server().host_and_port(); | 1830 host_and_port = proxy_info_.proxy_server().host_and_port(); |
| 1828 } else { | 1831 } else { |
| 1829 DCHECK(target == HttpAuth::AUTH_SERVER); | 1832 DCHECK(target == HttpAuth::AUTH_SERVER); |
| 1830 host_and_port = GetHostAndPort(request_->url); | 1833 host_and_port = GetHostAndPort(request_->url); |
| 1831 } | 1834 } |
| 1832 auth_info->host_and_port = ASCIIToWide(host_and_port); | 1835 auth_info->host_and_port = ASCIIToWide(host_and_port); |
| 1833 response_.auth_challenge = auth_info; | 1836 response_.auth_challenge = auth_info; |
| 1834 } | 1837 } |
| 1835 | 1838 |
| 1836 } // namespace net | 1839 } // namespace net |
| OLD | NEW |