I got an "onReceivedSslError" error in my Play Console account as in the screenshot.
I have handled the onReceivedSslError in all WebViewClients and show the required warning message. Then I sent the version to the market and got approval. The version has been released, but it still says this error is in this version, as seen above, under the version. Why is it showing up even though I applied it to all WebViewClients?
Related document sent: https://support.google.com/faqs/answer/7071387
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
Utilities.showAlertDialog(getActivity(),
"SSL Certificate Error", Utilities.getSslErrorMessage(error.getPrimaryError()),
getString(R.string.common_continue),
getString(R.string.order_detail_product_cancel),
() -> handler.proceed(),
() -> {
handler.cancel();
});
}
public static String getSslErrorMessage(int primaryErrorCode){
String message = "SSL Certificate error.";
switch (primaryErrorCode) {
case SslError.SSL_UNTRUSTED:
message = "The certificate authority is not trusted.";
break;
case SslError.SSL_EXPIRED:
message = "The certificate has expired.";
break;
case SslError.SSL_IDMISMATCH:
message = "The certificate Hostname mismatch.";
break;
case SslError.SSL_NOTYETVALID:
message = "The certificate is not yet valid.";
break;
}
message += " Do you want to continue anyway?";
return message;
}
Edit: The error turned yellow on the Play Console after a while, then it stopped coming at all. And I got an email that the error persists. I don't understand why this is so.
I'm on version 75 right now.
UPDATE II: I was still getting an error because of the webview used in the 3d verification screen in the payment sdk I used. So I asked them to fix the sdk. Right now I can't submit a version to the Play Store without fixing this error. But my existing application is still live with the last version I sent.