onReceivedServerTrustAuthRequest method
FutureOr<ServerTrustAuthResponse?> ?
onReceivedServerTrustAuthRequest(
- ServerTrustChallenge challenge
inherited
Event fired when the WebView need to perform server trust authentication (certificate validation).
The host application must return either ServerTrustAuthResponse instance with ServerTrustAuthResponseAction.CANCEL or ServerTrustAuthResponseAction.PROCEED.
challenge contains data about host, port, protocol, realm, etc. as specified in the ServerTrustChallenge.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebViewClient.onReceivedSslError)
- iOS WKWebView (Official API - WKNavigationDelegate.webView):
- To override the certificate verification logic, you have to provide ATS (App Transport Security) exceptions in your iOS/macOS
Info.plist. SeeNSAppTransportSecurityin the Information Property List Key Reference for details.
- To override the certificate verification logic, you have to provide ATS (App Transport Security) exceptions in your iOS/macOS
- macOS WKWebView (Official API - WKNavigationDelegate.webView):
- To override the certificate verification logic, you have to provide ATS (App Transport Security) exceptions in your iOS/macOS
Info.plist. SeeNSAppTransportSecurityin the Information Property List Key Reference for details.
- To override the certificate verification logic, you have to provide ATS (App Transport Security) exceptions in your iOS/macOS
- Windows WebView2 (Official API - ICoreWebView2_14.add_ServerCertificateErrorDetected)
Parameters - Officially Supported Platforms/Implementations:
challenge: all platforms
Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.
Implementation
@override
FutureOr<ServerTrustAuthResponse?>? onReceivedServerTrustAuthRequest(
ServerTrustChallenge challenge,
) {
return null;
}