| 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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 connection_.Reset(); | 1283 connection_.Reset(); |
| 1284 | 1284 |
| 1285 // If the user selected one of the certificate in client_certs for this | 1285 // If the user selected one of the certificate in client_certs for this |
| 1286 // server before, use it automatically. | 1286 // server before, use it automatically. |
| 1287 X509Certificate* client_cert = session_->ssl_client_auth_cache()-> | 1287 X509Certificate* client_cert = session_->ssl_client_auth_cache()-> |
| 1288 Lookup(GetHostAndPort(request_->url)); | 1288 Lookup(GetHostAndPort(request_->url)); |
| 1289 if (client_cert) { | 1289 if (client_cert) { |
| 1290 const std::vector<scoped_refptr<X509Certificate> >& client_certs = | 1290 const std::vector<scoped_refptr<X509Certificate> >& client_certs = |
| 1291 response_.cert_request_info->client_certs; | 1291 response_.cert_request_info->client_certs; |
| 1292 for (size_t i = 0; i < client_certs.size(); ++i) { | 1292 for (size_t i = 0; i < client_certs.size(); ++i) { |
| 1293 if (memcmp(&client_cert->fingerprint(), | 1293 if (client_cert->fingerprint() == client_certs[i]->fingerprint()) { |
| 1294 &client_certs[i]->fingerprint(), | |
| 1295 sizeof(X509Certificate::Fingerprint)) == 0) { | |
| 1296 ssl_config_.client_cert = client_cert; | 1294 ssl_config_.client_cert = client_cert; |
| 1297 ssl_config_.send_client_cert = true; | 1295 ssl_config_.send_client_cert = true; |
| 1298 next_state_ = STATE_INIT_CONNECTION; | 1296 next_state_ = STATE_INIT_CONNECTION; |
| 1299 // Reset the other member variables. | 1297 // Reset the other member variables. |
| 1300 // Note: this is necessary only with SSL renegotiation. | 1298 // Note: this is necessary only with SSL renegotiation. |
| 1301 ResetStateForRestart(); | 1299 ResetStateForRestart(); |
| 1302 return OK; | 1300 return OK; |
| 1303 } | 1301 } |
| 1304 } | 1302 } |
| 1305 } | 1303 } |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1707 host_and_port = proxy_info_.proxy_server().host_and_port(); | 1705 host_and_port = proxy_info_.proxy_server().host_and_port(); |
| 1708 } else { | 1706 } else { |
| 1709 DCHECK(target == HttpAuth::AUTH_SERVER); | 1707 DCHECK(target == HttpAuth::AUTH_SERVER); |
| 1710 host_and_port = GetHostAndPort(request_->url); | 1708 host_and_port = GetHostAndPort(request_->url); |
| 1711 } | 1709 } |
| 1712 auth_info->host_and_port = ASCIIToWide(host_and_port); | 1710 auth_info->host_and_port = ASCIIToWide(host_and_port); |
| 1713 response_.auth_challenge = auth_info; | 1711 response_.auth_challenge = auth_info; |
| 1714 } | 1712 } |
| 1715 | 1713 |
| 1716 } // namespace net | 1714 } // namespace net |
| OLD | NEW |