Handling SSL Certificates in Android WebView
The Problem
During development process if you are accessing a web page with SSL certificate you could either get a “Blank Page” or “Page Not Found” error.
The Solution
To prevent this from happening while developing your app, simply override “onReceivedSslError” of WebViewClient object and continue the execution process.
|
|
Security Considerations
By doing this, the SSL is being completely ignored and therefore could have a serious result if you forgot to remove the code after development and push the code into production.
To prevent that from happening simply check the build variants using BuildConfig.DEBUG
.