-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[webview_flutter_platform_interface] Adds support to respond to recoverable SSL certificate errors #9248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
auto-submit
merged 6 commits into
flutter:main
from
bparrishMines:webview_ssl_interface
May 16, 2025
Merged
[webview_flutter_platform_interface] Adds support to respond to recoverable SSL certificate errors #9248
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
80a52fa
add interface portion
bparrishMines 00ba3c3
version bump
bparrishMines 246d803
Merge branch 'main' of github.com:flutter/packages into webview_ssl_i…
bparrishMines c1e7c5b
Merge branch 'main' of github.com:flutter/packages into webview_ssl_i…
bparrishMines effddf0
update warning
bparrishMines def6811
Merge branch 'main' of github.com:flutter/packages into webview_ssl_i…
bparrishMines File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...s/webview_flutter/webview_flutter_platform_interface/lib/src/platform_ssl_auth_error.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
|
|
||
| import 'types/types.dart'; | ||
|
|
||
| /// Represents an SSL error with the associated certificate. | ||
| /// | ||
| /// The host application must call [cancel] or, contrary to secure web | ||
| /// communication standards, [proceed] to provide the web view's response to the | ||
| /// request. [proceed] should generally only be used in test environments, as | ||
| /// using it in production can expose users to security and privacy risks. | ||
| abstract class PlatformSslAuthError { | ||
| /// Creates a [PlatformSslAuthError]. | ||
| @protected | ||
| PlatformSslAuthError({required this.certificate, required this.description}); | ||
|
|
||
| /// The certificate associated with this error. | ||
| final X509Certificate? certificate; | ||
|
|
||
| /// A human-presentable description for a given error. | ||
| final String description; | ||
|
|
||
| /// Instructs the WebView that encountered the SSL certificate error to ignore | ||
| /// the error and continue communicating with the server. | ||
| /// | ||
| /// **Warning:** When an SSL error occurs, the host application should always | ||
| /// call [cancel] rather than [proceed] because an invalid SSL certificate | ||
| /// means the connection is not secure. | ||
| Future<void> proceed(); | ||
|
|
||
| /// Instructs the WebView that encountered the SSL certificate error to | ||
| /// terminate communication with the server. | ||
| /// | ||
| /// The host application must call this method to prevent a resource from | ||
| /// loading when an SSL certificate is invalid. | ||
| Future<void> cancel(); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...es/webview_flutter/webview_flutter_platform_interface/lib/src/types/x509_certificate.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
|
|
||
| /// Represents an X.509 certificate. | ||
| @immutable | ||
| class X509Certificate { | ||
| /// Creates an [X509Certificate]. | ||
| const X509Certificate({this.data}); | ||
|
|
||
| /// A DER representation of the certificate object. | ||
| final Uint8List? data; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was supposed to get the same wording change as above: "Warning: This should generally only be called in test environments, as using it in production can expose users to security and privacy risks."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to match: #9150 (comment)