且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

机器人的WebView SSL“安全警告”

更新时间:2023-11-19 08:39:58

创建WebViewClient和处理,看起来像这样的onReceivedSslError:

Create a WebViewClient and handle the onReceivedSslError which looks like this:

public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error)

在这个回调,你可以叫 handler.proceed()键,页面会继续加载。如果你不处理这个回调并调用进行()方法,那么默认的行为将是页面没有加载。

Inside this callback you can just call handler.proceed() and the page will continue loading. If you don't handle this callback and call the proceed() method then the default behaviour will be for the page not to load.