onReceivedServerTrustAuthRequest property

FutureOr<ServerTrustAuthResponse?> Function(T controller, ServerTrustChallenge challenge)? onReceivedServerTrustAuthRequest
final

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.

NOTE for iOS and macOS: to override the certificate verification logic, you have to provide ATS (App Transport Security) exceptions in your iOS/macOS Info.plist. See NSAppTransportSecurity in the Information Property List Key Reference for details.

Officially Supported Platforms/Implementations:

Implementation

final FutureOr<ServerTrustAuthResponse?> Function(
        T controller, ServerTrustChallenge challenge)?
    onReceivedServerTrustAuthRequest;