diff --git a/.gitignore b/.gitignore index 9491a2f..621be39 100644 --- a/.gitignore +++ b/.gitignore @@ -360,4 +360,6 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd + +.idea \ No newline at end of file diff --git a/src/Tingle.Extensions.PushNotifications/IServiceCollectionExtensions.cs b/src/Tingle.Extensions.PushNotifications/IServiceCollectionExtensions.cs index 5fdc1d2..8b68580 100644 --- a/src/Tingle.Extensions.PushNotifications/IServiceCollectionExtensions.cs +++ b/src/Tingle.Extensions.PushNotifications/IServiceCollectionExtensions.cs @@ -55,13 +55,12 @@ public static IHttpClientBuilder AddApnsNotifier(this IServiceCollection service var builder = services.AddNotifier(configure) .AddAuthenticationHandler(); - // APNS requires TLS 1.2 - builder.ConfigurePrimaryHttpMessageHandler(() => + // APNS requires TLS 1.2 or later + // https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns#2947606 + builder.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { - return new HttpClientHandler - { - SslProtocols = System.Security.Authentication.SslProtocols.Tls12 - }; + SslProtocols = System.Security.Authentication.SslProtocols.Tls12 + | System.Security.Authentication.SslProtocols.Tls13, }); return builder;