diff --git a/Directory.Build.props b/Directory.Build.props index 20ac85f1..a5607ffa 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -72,8 +72,6 @@ - net7.0-ios12.0; - net7.0-ios13.0; net8.0-ios12.0; net8.0-ios13.0 diff --git a/sandbox/OpenIddict.Sandbox.Maui.Client/MauiProgram.cs b/sandbox/OpenIddict.Sandbox.Maui.Client/MauiProgram.cs index 17efd7f3..1c5dc3db 100644 --- a/sandbox/OpenIddict.Sandbox.Maui.Client/MauiProgram.cs +++ b/sandbox/OpenIddict.Sandbox.Maui.Client/MauiProgram.cs @@ -1,4 +1,5 @@ #if IOS || WINDOWS +using System.Net.Http; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting.Internal; @@ -54,7 +55,14 @@ public static class MauiProgram // assembly as a more specific user agent, which can be useful when dealing with // providers that use the user agent as a way to throttle requests (e.g Reddit). options.UseSystemNetHttp() - .SetProductInformation(typeof(MauiProgram).Assembly); + .SetProductInformation(typeof(MauiProgram).Assembly) +#if IOS + // Warning: server certificate validation is disabled to simplify testing the MAUI + // application with the iOS simulator: in production, it SHOULD NEVER be disabled. + .ConfigureHttpClientHandler("Local", handler => handler.ServerCertificateCustomValidationCallback = + HttpClientHandler.DangerousAcceptAnyServerCertificateValidator) +#endif + ; // Add a client registration matching the client application definition in the server project. options.AddRegistration(new OpenIddictClientRegistration