Skip to content

[webview_flutter] handle onWebResourceError in onReceivedSslError on Android #74609

@ycherniavskyi

Description

@ycherniavskyi

Description

Currently, on Android, there is no possibility to get a notification in Flutter that an SSL error occurred while loading a resource.
The user sees a white screen, and the developer doesn't receive any error callbacks from WebView. Only in log developer can see some error:

[ERROR:ssl_client_socket_impl.cc(962)] handshake failed; returned -1, SSL error code 1, net_error -200

By the way, on iOS, the developer receives onWebResourceError callbacks with an appropriate error.

The reason that Android implementation doesn't implement/provide onReceivedSslError notifier.

My proposal is to left the default behavior of this notifier (call SslErrorHandler#cancel), but handle onWebResourceError callback from WebView, so the developer can see this error and provide some actions.

Related Issues & Pull requests

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterp: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions