下面是我从谷歌游戏中得到的信息。

在我看完这条消息之后,我看了一下谷歌帮助中心文章。我认为,这应该与WebViewClient类及其一些方法(如onReceivedSslError、SslErrorHandler.proceed()或SslErrorHandler.cancel() )相关。然后在我的项目中,我尝试搜索一些关键字,如WebViewClient、SslErrorHandler或onReceivedSslError。我也没有什么值得展示的结果。
有解决这个问题的建议吗?
发布于 2021-05-18 10:54:19
用“继续”和“取消”显示弹出或对话框。
继续handler.proceed()
取消handler.cancel()
当这个错误出现时,我们需要询问用户继续或停止。
像这样
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()https://stackoverflow.com/questions/48908482
复制相似问题