[Xamarin] WebView 因為 https 是自簽SSL憑證,以致無法顯示的問題

  • 761
  • 0

自簽SSL憑證,會造成 WebView 產生 SSL Errors ,以致無法正常顯示

自簽憑證 會觸發 WebView 的 OnReceivedSslError 事件,預設該事件裡面是  handler.cancel();,所以無法顯示網頁。

所以覆寫該事件,改成  handler.proceed();即可

注意,忽略SSL憑證問題,恐有資安疑慮:
http://devco.re/blog/2014/08/15/ssl-mishandling-on-mobile-app-development/