fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
https://pub.dev/packages/flutter_webview_plugin
Other
1.48k stars 931 forks source link

Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. #310

Open DylanZhuang opened 5 years ago

dpedrinha commented 4 years ago

I'm having the same problem. Need a way to add a badCertificateCallback to validate the URL and accept the connection.

Something like this: client.badCertificateCallback = ((X509Certificate cert, String host, int port) { final isValidHost = host == 'valid.url.com'; return isValidHost; });