1

Below is the message I get from Google Play.

enter image description here

After I read the message, I take a look on Google Help Center article. For what I thought, this should be related to the class of WebViewClient and some of its methods like onReceivedSslError, SslErrorHandler.proceed() or SslErrorHandler.cancel(). Then in my project, I try to search some keywords like WebViewClient, SslErrorHandler or onReceivedSslError. I also get the result of Nothing to show.

Any suggestions to solve this issue?

Pak Ho Cheung
  • 1,402
  • 6
  • 19
  • 41
  • 1
    You might be using a library that has this problem. You're responsible for everything you ship with your APK. – laalto Feb 21 '18 at 14:34
  • Make sure that you are using the latest versions of any libraries that you have as dependencies. Use the APK Analyzer in Android Studio to see if something is referencing those methods, rather than searching the source code, in case the problem is coming from a library. – CommonsWare Feb 21 '18 at 14:34
  • @CommonsWare I am using APK Analyzer. Any quick way to search those methods? – Pak Ho Cheung Feb 21 '18 at 15:00
  • Go into `classes.dex`, then drill down into `android.webkit` and so forth. – CommonsWare Feb 21 '18 at 15:02

1 Answers1

0

show pop up or dialog with continue and cancel.
continue handler.proceed()
cancel handler.cancel()

we need ask user, when this error comes, to continue or to stop.

like this

val builder = AlertDialog.Builder(cntx)
        var message = "SSL Certificate error."
        when (error?.primaryError) {
            SslError.SSL_UNTRUSTED -> message = "The certificate authority is not trusted."
            SslError.SSL_EXPIRED -> message = "The certificate has expired."
            SslError.SSL_IDMISMATCH -> message = "The certificate Hostname mismatch."
            SslError.SSL_NOTYETVALID -> message = "The certificate is not yet valid."
        }
        message += " Do you want to continue anyway?"

        builder.setTitle("SSL Certificate Error")
        builder.setMessage(message)
        builder.setPositiveButton(
            "continue"
        ) { dialog, which -> handler?.proceed() }
        builder.setNegativeButton(
            "cancel"
        ) { dialog, which -> handler?.cancel() }
        val dialog = builder.create()
        dialog.show()
Gv Ravi
  • 25
  • 3