I recently received an email from Google with the following subject : \"Google Play Warning: SSL Error Handler Vulnerability\". In this email, Google explains that my app has an
The problem is in your code. When you call handler.proceed();
like that, it effectively removes all the security from your connection.
You should remove your onReceivedSslError
method. The default implementation will reject insecure connections.
I hope is not too late for this.. that warning is about you should notify user is going to a page with invalid cert, you should not proceed it directly.
You can implment an alert dialog something like this:
@Override
public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.notification_error_ssl_cert_invalid);
builder.setPositiveButton("continue", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
handler.proceed();
}
});
builder.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
handler.cancel();
}
});
final AlertDialog dialog = builder.create();
dialog.show();
}
This was taken from sakiM answers in this link: Webview avoid security alert from google play upon implementation of onReceivedSslError