Issue
I'm building a test version of an app for a client. Part of this app uses a WebView that calls out to a SSL-based site. In turn, the client has provided a test domain where the certificate name does not match the FQDN. Alas, they are not in a position to provision a cert that matches. :(
I'm working around this issue on the companion iOS ad hoc app with one line of code (again, not for production use - just for test purposes). I have searched for similar info on Android OS, but the solutions I've seen here and elsewhere are enough to make my head spin big time by comparison!
Is there a straightforward way to work around this? Even a user-facing setting tucked away somewhere?
Clues appreciated!
Solution
Create a WebViewClient and handle the onReceivedSslError which looks like this:
public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error)
Inside this callback you can just call handler.proceed()
and the page will continue loading. If you don't handle this callback and call the proceed()
method then the default behaviour will be for the page not to load.
Answered By - Lee
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.