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 4ef4c6f439a3c43abf6ac0db48de5597071e44c3..76a34ef9bde4109b04f59318305720ad691ca0ed 100644 |
--- a/chrome/browser/chrome_content_browser_client.cc |
+++ b/chrome/browser/chrome_content_browser_client.cc |
@@ -158,6 +158,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" |
@@ -468,6 +469,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. |
@@ -485,6 +487,7 @@ bool CertMatchesFilter(const net::X509Certificate& cert, |
} |
return false; |
} |
+#endif |
#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( |
@@ -2052,6 +2055,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://" |
@@ -2078,7 +2084,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; |
} |
} |
@@ -2086,6 +2097,7 @@ void ChromeContentBrowserClient::SelectClientCertificate( |
NOTREACHED(); |
} |
} |
+#endif |
chrome::ShowSSLClientCertificateSelector(web_contents, cert_request_info, |
std::move(delegate)); |