Skip to content

Commit e3d8706

Browse files
Docs: Add certificate-error handling docs & API notes (#389)
Document and annotate the new EnableIgnoreCertificateErrors builder behavior. Updated core docs and migration guides to describe the startup-only API, security warning, builder/native defaults (builder:true, native:false), and platform-specific implementations (Windows: --ignore-certificate-errors WebView2 flag; Linux: WEBKIT_TLS_ERRORS_POLICY_IGNORE; macOS: trust in didReceiveAuthenticationChallenge:). Added XML docs to IBrowserInfiniFrameWindowBuilderFeature and its extensions and clarified tests to note runtime assignment is unsupported.
1 parent b29d37e commit e3d8706

6 files changed

Lines changed: 65 additions & 2 deletions

File tree

‎docs/docs/guides/core-window.md‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,23 @@ builder
178178
.SetJavascriptClipboardAccessEnabled(true)
179179
.SetMediaStreamEnabled(true) // Camera/microphone access
180180
.SetSmoothScrollingEnabled()
181-
.SetIgnoreCertificateErrorsEnabled()
181+
.EnableIgnoreCertificateErrors()
182182
.SetUserAgent("MyApp/1.0")
183183
```
184184

185+
### Certificate Error Handling
186+
187+
`EnableIgnoreCertificateErrors(bool)` controls whether SSL/TLS certificate errors are ignored by the browser engine.
188+
189+
> ⚠️ **Security Warning**: Enabling this feature bypasses SSL/TLS certificate validation. Only use in controlled development/test scenarios. Never enable in production applications handling sensitive data.
190+
191+
- This is a **startup-only** configuration and cannot be changed at runtime.
192+
- The builder default is `true`; the native layer default is `false`.
193+
- Platform-specific behavior:
194+
- **Windows**: Passes `--ignore-certificate-errors` Chromium flag to WebView2
195+
- **Linux**: Sets `WEBKIT_TLS_ERRORS_POLICY_IGNORE` on WebKit data manager
196+
- **macOS**: Trusts all server certificates in `didReceiveAuthenticationChallenge:` delegate
197+
185198
## DevTools and Remote Debugging
186199

187200
`SetDevToolsEnabled(bool)` and remote debugging are separate controls:

‎docs/docs/migration/photino-backlog.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ This backlog will be used to track any remaining issues or features that need to
6969
| ✅ | Problem with "insecure origins" | [Photino.NET#25](https://github.com/tryphotino/photino.NET/issues/25) | |
7070
| ❓ | JS injection into WebView | [Photino.NET#58](https://github.com/tryphotino/photino.NET/issues/58) | |
7171
| 📝 | Creating a 2nd PhotinoWindow after closing all others fails | [Photino.NET#59](https://github.com/tryphotino/photino.NET/issues/59) | [InfiniFrame#290](https://github.com/InfiniLore/InfiniFrame/issues/290) |
72-
| 📝 | Is there a way to bypass WebKits SSL check? | [Photino.NET#65](https://github.com/tryphotino/photino.NET/issues/65) | [InfiniFrame#291](https://github.com/InfiniLore/InfiniFrame/issues/291) |
72+
| ✅ | Is there a way to bypass WebKits SSL check? | [Photino.NET#65](https://github.com/tryphotino/photino.NET/issues/65) | [InfiniFrame#291](https://github.com/InfiniLore/InfiniFrame/issues/291) - First-class `EnableIgnoreCertificateErrors(bool)` builder API with platform-specific implementations (Windows: WebView2 Chromium flag, Linux: WebKit TLS policy, macOS: certificate trust delegate) |
7373
| ✅ | Javascript debugging | [Photino.NET#71](https://github.com/tryphotino/photino.NET/issues/71) | [InfiniFrame#292](https://github.com/InfiniLore/InfiniFrame/issues/292) - explicit `SetRemoteDebuggingPort`, loopback-only endpoint on Windows/WebKitGTK Linux, deterministic lifecycle, macOS unsupported behavior, plus capability-gated diagnostics under `window.Debug` |
7474
| ❓ | Make window transparent | [Photino.NET#73](https://github.com/tryphotino/photino.NET/issues/73) | |
7575
| ❓ | Chromeless Window | [Photino.NET#80](https://github.com/tryphotino/photino.NET/issues/80) | |

‎docs/docs/migration/photino-breaking-changes.md‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This document walks through what changed to help you migrate.
1313
- [Event System](#event-system)
1414
- [Web Messaging and Message Routing](#web-messaging-and-message-routing)
1515
- [Web Security, CORS, and Trusted Origins](#web-security-cors-and-trusted-origins)
16+
- [Certificate Error Handling](#certificate-error-handling)
1617
- [Logging](#logging)
1718
- [Native C++ Interface](#native-c-interface)
1819
- [Known Photino Issues Addressed](#known-photino-issues-addressed)
@@ -266,6 +267,45 @@ var app = InfiniFrameBlazorAppBuilder.CreateDefault(windowBuilder: wb => {
266267
| Trust all origins (explicit opt-in) | `builder.SetTrustAllOrigins(true)` |
267268
| Browser engine security toggle | `builder.SetWebSecurityEnabled(bool)` |
268269

270+
## Certificate Error Handling
271+
272+
### Photino: no built-in API
273+
274+
Photino had no built-in API for bypassing SSL/certificate errors. Users needed custom handling, often involving raw browser startup arguments or platform-specific workarounds.
275+
276+
### InfiniFrame: first-class API
277+
278+
InfiniFrame provides a first-class `EnableIgnoreCertificateErrors(bool)` API:
279+
280+
```csharp
281+
var window = InfiniFrameWindowBuilder.Create()
282+
.EnableIgnoreCertificateErrors(true) // Default: true in builder
283+
.Build();
284+
```
285+
286+
- **Builder-time configuration only** — like Photino's behavior, this is startup-only and cannot be changed at runtime.
287+
- **Default is `true`** in the builder, `false` in the native layer.
288+
- **Platform-specific behavior**:
289+
- Windows: Passes `--ignore-certificate-errors` Chromium flag to WebView2
290+
- Linux: Sets `WEBKIT_TLS_ERRORS_POLICY_IGNORE` on WebKit data manager
291+
- macOS: Trusts all server certificates in `didReceiveAuthenticationChallenge:` delegate
292+
293+
### Migration pattern
294+
295+
Replace custom certificate bypass code with the builder API:
296+
297+
```csharp
298+
// Before (Photino custom workaround)
299+
// window.SetBrowserControlInitParameters("--ignore-certificate-errors");
300+
301+
// After (InfiniFrame)
302+
var window = InfiniFrameWindowBuilder.Create()
303+
.EnableIgnoreCertificateErrors(true)
304+
.Build();
305+
```
306+
307+
> ⚠️ **Security Warning**: Enabling this feature bypasses SSL/TLS certificate validation. Only use in controlled development/test scenarios. Never enable in production applications handling sensitive data.
308+
269309
## Logging
270310

271311
### Photino: integer verbosity

‎src/InfiniFrame.Shared/Window/Features/Browser/IBrowserInfiniFrameWindowBuilderFeature.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ public interface IBrowserInfiniFrameWindowBuilderFeature : IInfiniFrameWindowBui
115115

116116
/// <summary>
117117
/// Enables or disables ignoring certificate errors.
118+
/// <para>⚠️ Security Warning: Enabling this feature bypasses SSL/TLS certificate validation. Only use in controlled development/test scenarios. Never enable in production applications handling sensitive data.</para>
119+
/// <para>This is a startup-only configuration and cannot be changed at runtime.</para>
120+
/// <para>Platform-specific behavior: Windows passes --ignore-certificate-errors Chromium flag to WebView2; Linux sets WEBKIT_TLS_ERRORS_POLICY_IGNORE on WebKit data manager; macOS trusts all server certificates in didReceiveAuthenticationChallenge: delegate.</para>
118121
/// </summary>
119122
/// <param name="enabled">Whether certificate errors should be ignored.</param>
120123
void EnableIgnoreCertificateErrors(bool enabled);

‎src/InfiniFrame.Shared/Window/Features/Browser/IBrowserInfiniFrameWindowBuilderFeatureExtensions.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ public static IInfiniFrameWindowBuilder EnableMediaStream(this IInfiniFrameWindo
8585

8686
/// <summary>
8787
/// Enables or disables ignoring certificate errors for the builder.
88+
/// <para>⚠️ Security Warning: Enabling this feature bypasses SSL/TLS certificate validation. Only use in controlled development/test scenarios. Never enable in production applications handling sensitive data.</para>
89+
/// <para>This is a startup-only configuration and cannot be changed at runtime.</para>
90+
/// <para>Platform-specific behavior: Windows passes --ignore-certificate-errors Chromium flag to WebView2; Linux sets WEBKIT_TLS_ERRORS_POLICY_IGNORE on WebKit data manager; macOS trusts all server certificates in didReceiveAuthenticationChallenge: delegate.</para>
8891
/// </summary>
8992
/// <param name="builder">The builder instance.</param>
9093
/// <param name="enabled">Whether certificate errors should be ignored.</param>

‎tests/InfiniTests.InfiniFrame/Window/Features/Browser/IgnoreCertificateErrorsTests.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public async Task AtBuilderStage_ExtensionAssignment(bool value, CancellationTok
4343
await Assert.That(initParameters.IgnoreCertificateErrorsEnabled).IsEqualTo(value);
4444
}
4545

46+
// NOTE: Direct runtime assignment of IgnoreCertificateErrors is not supported because the native layer
47+
// only implements a getter (read from init params). The value is startup-only and cannot be changed
48+
// after window creation. Use AtWindowStage_ThroughBuilderAssignment to test the builder-time path.
49+
//
4650
// [Test]
4751
// [NotInParallelInfiniTests]
4852
// [Arguments(true)]

0 commit comments

Comments
 (0)