Index: chrome/browser/chrome_content_browser_client.cc |
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc |
index a3910fbf24a2af7060f17d9739feaad8a074f92c..9ed2615fe841cb0a494c3cf419b0acbb7f967c38 100644 |
--- a/chrome/browser/chrome_content_browser_client.cc |
+++ b/chrome/browser/chrome_content_browser_client.cc |
@@ -149,6 +149,7 @@ |
#include "net/cookies/canonical_cookie.h" |
#include "net/cookies/cookie_options.h" |
#include "net/ssl/ssl_cert_request_info.h" |
+#include "net/ssl/ssl_platform_key.h" |
#include "ppapi/host/ppapi_host.h" |
#include "storage/browser/fileapi/external_mount_points.h" |
#include "ui/base/l10n/l10n_util.h" |
@@ -441,6 +442,7 @@ bool HandleWebUIReverse(GURL* url, content::BrowserContext* browser_context) { |
return RemoveUberHost(url); |
} |
+#if !defined(OS_ANDROID) |
bool CertMatchesFilter(const net::X509Certificate& cert, |
const base::DictionaryValue& filter) { |
// TODO(markusheintz): This is the minimal required filter implementation. |
@@ -458,6 +460,7 @@ bool CertMatchesFilter(const net::X509Certificate& cert, |
} |
return false; |
} |
+#endif |
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( |
@@ -1977,6 +1980,9 @@ void ChromeContentBrowserClient::SelectClientCertificate( |
return; |
} |
+// Android can't support CONENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE since |
+// the platform doesn't provide a list of matching certificates. |
+#if !defined(OS_ANDROID) |
GURL requesting_url("https://" + cert_request_info->host_and_port.ToString()); |
DCHECK(requesting_url.is_valid()) |
<< "Invalid URL string: https://" |
@@ -2003,7 +2009,12 @@ void ChromeContentBrowserClient::SelectClientCertificate( |
for (size_t i = 0; i < all_client_certs.size(); ++i) { |
if (CertMatchesFilter(*all_client_certs[i].get(), *filter_dict)) { |
// Use the first certificate that is matched by the filter. |
- delegate->ContinueWithCertificate(all_client_certs[i].get()); |
+ // The following is not supported on Android since the client_certs |
+ // list |
+ // won't be populated. |
+ delegate->ContinueWithCertificate( |
+ all_client_certs[i].get(), |
+ net::FetchClientCertPrivateKey(all_client_certs[i].get()).get()); |
return; |
} |
} |
@@ -2011,6 +2022,7 @@ void ChromeContentBrowserClient::SelectClientCertificate( |
NOTREACHED(); |
} |
} |
+#endif |
chrome::ShowSSLClientCertificateSelector(web_contents, cert_request_info, |
delegate.Pass()); |