flutter handshake failed; returned -1, SSL error code 1, net_error -202


1.用這個插件顯示網頁

webview_flutter: ^1.0.7

報錯

handshake failed; returned -1, SSL error code 1, net_error -202

2.解決辦法

用這個插件

flutter_inappwebview: ^4.0.0+4

具體代碼

InAppWebView(
  initialUrl: _url,
  onReceivedServerTrustAuthRequest: (controller, challenge) async {
      //解決 handshake failed問題
      return ServerTrustAuthResponse(
          action: ServerTrustAuthResponseAction.PROCEED);
  },
    onLoadStop: (InAppWebViewController controller, String url) {
        loadingDismiss();
        print("網頁 onLoadStop--》");
    },
)

參考 https://stackoverflow.com/questions/62038787/fluttere-webview-handshake-failed


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM