Confused about handling SSL Errors in WebView

by whitemice » Fri, 13 Feb 2009 20:54:42 GMT


Sponsored Links
 I have a WebView and I want to capture an error, most likely related
to a web page having an invalid SSL certificate (company Intranet).
Currently the MyWebViewClient.onPageStarted() method is called, and no
secure content is shown the the page.

Generally I would expect WebViewClient.onReceivedError() to be called
to handle this situation, although the documentation is not quite
clear on exactly what kind of errors this method covers.

Looking at the Android Browser implementation source code, it seems to
call WebViewClient.onReceivedSslError() on line 2954, which triggers
the relevant site certificate prompt:
 http://android.git.kernel.org/?p=platform/packages/apps/Browser.git ;a=blob;f=src/com/android/browser/BrowserActivity.java

...which of course is a method that was removed in 0.9:
 http://code.google.com/android/migrating/m5-0.9/changes/android.webkit.WebViewClient.html 

I am not clued up enough to take on the WebKit source and can't find
any documentation on what if anything has replaced the
onReceivedSslError() method.

Is this a bug/omission in the Android platform?  How was the
"release-1.0" browser complied with missing classes?  Am I doing
something completely wrong?

Thanks in advance for your feedback.
Mark

--~--~---------~--~----~------------~-------~--~----~



Confused about handling SSL Errors in WebView

by Manuel » Sat, 21 Feb 2009 01:48:35 GMT


 I have the same problem, and didn't manage to find a way even to
detect the error. Any clues?




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Confused about handling SSL Errors in WebView

by whitemice » Tue, 24 Feb 2009 17:00:59 GMT


 Hi Manuel
So far no luck.
I'm sure any solution will involved the "SslErrorHandler" class, but I
have so far failed to find any post 1.0 example code.
 http://developer.android.com/reference/android/webkit/SslErrorHandler.html 

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How can I see LOGV content in 'adb logcat'

Hi,

I put calls to LOGV() in my cpp file in WebKit code in andorid, but I
don't see any log statements when I run 'adb logcat' in another shell.
But as soon as I change it to LOGE(), i see them.
Can you please tell me how can I see the log content of LOGV?

Thank you.

--~--~---------~--~----~------------~-------~--~----~

2. Webview question: Is it possible to execute Javascript from Java synchronously?

This doesn't make any sense, though. If you're inside in.read(), you should
be sleeping, waiting for the network transfer to complete. So the WebKit
thread *should* have some time to process your loadUrl() requests .....










--~--~---------~--~----~------------~-------~--~----~

3. Webview question: Is it possible to execute Javascript from Java synchronously?

4. Conference FYI (Flourish 2009)

5. Animation Issue

6. Cupcake SDKs available for download

7. Books on Android development?