From ece23ee6efde57d6654b1e0b87418fae1f0d45c3 Mon Sep 17 00:00:00 2001 From: "CLINITEC\\NSoni" Date: Tue, 23 Jan 2018 18:21:54 -0600 Subject: [PATCH] Added support for higher TLS versions --- 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 0908b166..371151b3 100644 --- a/PushSharp.Apple/ApnsConnection.cs +++ b/PushSharp.Apple/ApnsConnection.cs @@ -354,7 +354,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 57fb887a..1d078318 100644 --- a/PushSharp.Apple/ApnsFeedbackService.cs +++ b/PushSharp.Apple/ApnsFeedbackService.cs @@ -38,7 +38,8 @@ public void Check () (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