summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorHuahui Wu <hwu@google.com>2010-12-01 11:24:06 -0800
committerHuahui Wu <hwu@google.com>2010-12-01 11:24:06 -0800
commitde555adf770281cc8755d4436190db3860bf2249 (patch)
tree6196aebfae0e80e05c91ea1da8626ac2ba42f6df /WebKit/android
parent6bd88008bc13895cca3e78ccb0460a61d3be331f (diff)
downloadexternal_webkit-de555adf770281cc8755d4436190db3860bf2249.zip
external_webkit-de555adf770281cc8755d4436190db3860bf2249.tar.gz
external_webkit-de555adf770281cc8755d4436190db3860bf2249.tar.bz2
b/2864818 setting the appropriate error code for certificate error.
Change-Id: I628b6fdd82089207c5a25ad816d3e6475d85911a
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.cpp8
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.h1
-rw-r--r--WebKit/android/WebCoreSupport/WebViewClientError.cpp10
3 files changed, 19 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequest.cpp b/WebKit/android/WebCoreSupport/WebRequest.cpp
index 366c3c9..b7f2c8b 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequest.cpp
@@ -319,6 +319,14 @@ void WebRequest::OnAuthRequired(URLRequest* request, net::AuthChallengeInfo* aut
m_urlLoader.get(), &WebUrlLoaderClient::authRequired, authInfoPtr, firstTime));
}
+// Called when we received an SSL certificate error. Right now, we only
+// set the appropriate error code. FIXME: the delegate should provide
+// the user the options to proceed, cancel, or view certificates.
+void WebRequest::OnSSLCertificateError(URLRequest* request, int cert_error, net::X509Certificate* cert)
+{
+ request->SimulateError(cert_error);
+}
+
// After calling Start(), the delegate will receive an OnResponseStarted
// callback when the request has completed. If an error occurred, the
// request->status() will be set. On success, all redirects have been
diff --git a/WebKit/android/WebCoreSupport/WebRequest.h b/WebKit/android/WebCoreSupport/WebRequest.h
index 98e2921..fb756ab 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.h
+++ b/WebKit/android/WebCoreSupport/WebRequest.h
@@ -73,6 +73,7 @@ public:
virtual void OnResponseStarted(URLRequest*);
virtual void OnReadCompleted(URLRequest*, int bytesRead);
virtual void OnAuthRequired(URLRequest*, net::AuthChallengeInfo*);
+ virtual void OnSSLCertificateError(URLRequest* request, int cert_error, net::X509Certificate* cert);
// Methods called during a request by the UI code (via WebUrlLoaderClient).
void setAuth(const string16& username, const string16& password);
diff --git a/WebKit/android/WebCoreSupport/WebViewClientError.cpp b/WebKit/android/WebCoreSupport/WebViewClientError.cpp
index 8e50cfe..9744efb 100644
--- a/WebKit/android/WebCoreSupport/WebViewClientError.cpp
+++ b/WebKit/android/WebCoreSupport/WebViewClientError.cpp
@@ -101,6 +101,16 @@ WebViewClientError ToWebViewClientError(net::Error error) {
case ERR_SSL_SNAP_START_NPN_MISPREDICTION:
case ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED:
case ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY:
+ case ERR_CERT_COMMON_NAME_INVALID:
+ case ERR_CERT_DATE_INVALID:
+ case ERR_CERT_AUTHORITY_INVALID:
+ case ERR_CERT_CONTAINS_ERRORS:
+ case ERR_CERT_NO_REVOCATION_MECHANISM:
+ case ERR_CERT_UNABLE_TO_CHECK_REVOCATION:
+ case ERR_CERT_REVOKED:
+ case ERR_CERT_INVALID:
+ case ERR_CERT_WEAK_SIGNATURE_ALGORITHM:
+ case ERR_CERT_NOT_IN_DNS:
return ERROR_FAILED_SSL_HANDSHAKE;
case ERR_PROXY_AUTH_UNSUPPORTED: