diff options
| author | 2011-02-10 14:40:50 -0800 | |
|---|---|---|
| committer | 2011-02-10 14:40:50 -0800 | |
| commit | c56c3e262c0fac05abb2d1c98acd0ee68f9e428d (patch) | |
| tree | c3f9d32062ede2abec324e5d00b421e792917d96 | |
| parent | 5e2b123e483a6da1b7cff36024b12e85a0a7c382 (diff) | |
b/3416864 Send the cert info from Native to Java side.
Change-Id: Ib4f045f0dd58d85b329eae972c4a4a61ee95f078
| -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; + } } //========================================================================== |