Index: chrome/browser/renderer_host/resource_dispatcher_host.cc |
=================================================================== |
--- chrome/browser/renderer_host/resource_dispatcher_host.cc (revision 19366) |
+++ chrome/browser/renderer_host/resource_dispatcher_host.cc (working copy) |
@@ -33,6 +33,7 @@ |
#include "chrome/browser/renderer_host/safe_browsing_resource_handler.h" |
#include "chrome/browser/renderer_host/save_file_resource_handler.h" |
#include "chrome/browser/renderer_host/sync_resource_handler.h" |
+#include "chrome/browser/ssl/ssl_client_auth_handler.h" |
#include "chrome/browser/tab_contents/tab_util.h" |
#include "chrome/browser/tab_contents/tab_contents.h" |
#include "chrome/common/chrome_switches.h" |
@@ -645,6 +646,10 @@ |
info->login_handler->OnRequestCancelled(); |
info->login_handler = NULL; |
} |
+ if (info->ssl_client_auth_handler) { |
+ info->ssl_client_auth_handler->OnRequestCancelled(); |
+ info->ssl_client_auth_handler = NULL; |
+ } |
if (!i->second->is_pending() && allow_delete) { |
// No io is pending, canceling the request won't notify us of anything, |
// so we explicitly remove it. |
@@ -879,12 +884,18 @@ |
net::SSLCertRequestInfo* cert_request_info) { |
DCHECK(request); |
- bool select_first_cert = CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kAutoSSLClientAuth); |
- net::X509Certificate* cert = |
- select_first_cert && !cert_request_info->client_certs.empty() ? |
- cert_request_info->client_certs[0] : NULL; |
- request->ContinueWithCertificate(cert); |
+ if (cert_request_info->client_certs.empty()) { |
+ // No need to query the user if there are no certs to choose from. |
+ request->ContinueWithCertificate(NULL); |
+ return; |
+ } |
+ |
+ ExtraRequestInfo* info = ExtraInfoForRequest(request); |
+ DCHECK(!info->ssl_client_auth_handler) << |
+ "OnCertificateRequested called with ssl_client_auth_handler pending"; |
+ info->ssl_client_auth_handler = |
+ new SSLClientAuthHandler(request, cert_request_info, io_loop_, ui_loop_); |
+ info->ssl_client_auth_handler->SelectCertificate(); |
} |
void ResourceDispatcherHost::OnSSLCertificateError( |