diff options
| author | 2011-02-10 15:00:23 -0800 | |
|---|---|---|
| committer | 2011-02-10 15:00:23 -0800 | |
| commit | 36d2823e5700dba32438ce761930f94b40d0b660 (patch) | |
| tree | f0578fc5f23d36f5e725edb272f0c33ae36e0ef4 | |
| parent | cd2e2642125d54352130233d29d080ab57fe981d (diff) | |
| parent | c56c3e262c0fac05abb2d1c98acd0ee68f9e428d (diff) | |
Merge "b/3416864 Send the cert info from Native to Java side."
| -rw-r--r-- | core/java/android/webkit/BrowserFrame.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java index d6c58ebb4583..8e099864708f 100644 --- a/core/java/android/webkit/BrowserFrame.java +++ b/core/java/android/webkit/BrowserFrame.java @@ -1121,7 +1121,7 @@ class BrowserFrame extends Handler { } /** - * Called by JNI when the native HTTP(S) stack gets a invalid cert chain. + * Called by JNI when the native HTTP(S) stack gets an invalid cert chain. * * We delegate the request to CallbackProxy, and route its response to * {@link #nativeSslCertErrorProceed(int)} or @@ -1133,8 +1133,8 @@ class BrowserFrame extends Handler { X509Certificate cert = new X509CertImpl(cert_der); ssl_error = new SslError(cert_error, cert); } catch (IOException e) { - // Can't get the cert, not much to do. - Log.e(LOGTAG, "Can't get the certificate from WebKit, cancling"); + // Can't get the certificate, not much to do. + Log.e(LOGTAG, "Can't get the certificate from WebKit, canceling"); nativeSslCertErrorCancel(handle, cert_error); return; } @@ -1209,12 +1209,15 @@ class BrowserFrame extends Handler { /** * Called by JNI when we load a page over SSL. */ - private void setCertificate(String issuedTo, String issuedBy, - long validNotBeforeMillis, long validNotAfterMillis) { - Date validNotBefore = new Date(validNotBeforeMillis); - Date validNotAfter = new Date(validNotAfterMillis); - mCallbackProxy.onReceivedCertificate(new SslCertificate( - issuedTo, issuedBy, validNotBefore, validNotAfter)); + private void setCertificate(byte cert_der[]) { + try { + X509Certificate cert = new X509CertImpl(cert_der); + mCallbackProxy.onReceivedCertificate(new SslCertificate(cert)); + } catch (IOException e) { + // Can't get the certificate, not much to do. + Log.e(LOGTAG, "Can't get the certificate from WebKit, canceling"); + return; + } } //========================================================================== |