flutter_inappwebview 忽略证书
2024-04-17 本文已影响0人
YannChee
以下代码只适用于测试环境,生产环境不推荐
在访问https证书的网站,如果用浏览器访问,效果如下

如果使用flutter_inappwebview 访问则网页白屏,
解决办法
在flutter_inappwebview的回调方法中 onReceivedServerTrustAuthRequest ,返回如下结果
onReceivedServerTrustAuthRequest:
(webViewController, authenticationChallenge) async {
return ServerTrustAuthResponse(
action: ServerTrustAuthResponseAction.PROCEED);
}