From cfb8b27dee84cadf36a93fb3ef4c56eef4e9983f Mon Sep 17 00:00:00 2001 From: Roman Midyk Date: Thu, 9 Jan 2020 12:48:03 +0200 Subject: [PATCH] APNS - Add TLS1.1 and TLS1.2 support --- PushSharp.Apple/ApnsConnection.cs | 3 ++- PushSharp.Apple/ApnsFeedbackService.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PushSharp.Apple/ApnsConnection.cs b/PushSharp.Apple/ApnsConnection.cs index 8a8d553b..6884f44b 100644 --- a/PushSharp.Apple/ApnsConnection.cs +++ b/PushSharp.Apple/ApnsConnection.cs @@ -402,7 +402,8 @@ async Task connect () (sender, targetHost, localCerts, remoteCert, acceptableIssuers) => certificate); try { - stream.AuthenticateAsClient (Configuration.Host, certificates, System.Security.Authentication.SslProtocols.Tls, false); + var tls = System.Security.Authentication.SslProtocols.Tls | System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls12; + stream.AuthenticateAsClient (Configuration.Host, certificates, tls, false); } catch (System.Security.Authentication.AuthenticationException ex) { throw new ApnsConnectionException ("SSL Stream Failed to Authenticate as Client", ex); } diff --git a/PushSharp.Apple/ApnsFeedbackService.cs b/PushSharp.Apple/ApnsFeedbackService.cs index 53659ac9..6859bef0 100644 --- a/PushSharp.Apple/ApnsFeedbackService.cs +++ b/PushSharp.Apple/ApnsFeedbackService.cs @@ -57,7 +57,8 @@ public IEnumerable GetTokenExpirations() (sender, cert, chain, sslErrs) => { return true; }, (sender, targetHost, localCerts, remoteCert, acceptableIssuers) => { return certificate; }); - stream.AuthenticateAsClient(Configuration.FeedbackHost, certificates, System.Security.Authentication.SslProtocols.Tls, false); + var tls = System.Security.Authentication.SslProtocols.Tls | System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls12; + stream.AuthenticateAsClient(Configuration.FeedbackHost, certificates, tls, false); //Set up