Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for APNS Sandbox notifications that were no longer working #369

Merged
merged 2 commits into from May 23, 2014

Conversation

Projects
None yet
@coffeesmurf
Copy link

coffeesmurf commented Apr 16, 2014

Changed the SSL protocol used for APNS from SSL3 to TLS. Using SSL3 was no longer working for the APNS sandbox environment.

Philippe Lalonde
Changed SSL protocol used for APNS from SSL3 to TLS. Using SSL3 was n…
…o longer working for the APNS sandbox environment
@GlushenkovSV

This comment has been minimized.

Copy link

GlushenkovSV commented on 51b1944 Apr 17, 2014

Replaced, but the problem persists. What else can I do?
Will work with production certificate ssl3?

This comment has been minimized.

Copy link

GlushenkovSV replied Apr 17, 2014

I knew where else an error occurs. Still need to replace the file FeedbackService

@coffeesmurf

This comment has been minimized.

Copy link
Author

coffeesmurf commented Apr 17, 2014

Good point! I changed the protocol for the feedback service as well.

Currently TLS appears to be working for both Sandbox and Production, whereas SSL3 only works for Production. Strange that I'm still unable to find anything on Apple's side describing the change on their end. If they rolled this out to sandbox first, we can probably expect (I'm guessing) that it will be rolled out to Production at some point.

@alaeddineG

This comment has been minimized.

Copy link

alaeddineG commented Apr 17, 2014

Thank you coffeesmurf.
for my part I will not go to production with this until Apple tell something about this unexpected change.
For PushSharp : when can we expect a merge of the fix you did ?

@pwiesner

This comment has been minimized.

Copy link

pwiesner commented Apr 17, 2014

+1 The change worked for me. I dropped the updated PushSharp.Apple.dll on my dev servers and everything seems to be working. I will report back if I see any problems or hear anything from Apple.

@lukeconner

This comment has been minimized.

Copy link

lukeconner commented Apr 17, 2014

I've tried making the change from Ssl3 to Default and Tls in the FeedbackService and the ApplePushChannel file. Neither change seems to work for me.

@alaeddineG

This comment has been minimized.

Copy link

alaeddineG commented Apr 17, 2014

Verify if your certificate is valid in the member center ! The change worked for me anyway

@coffeesmurf

This comment has been minimized.

Copy link
Author

coffeesmurf commented Apr 17, 2014

@lukeconner Was it working for you until only recently? As @alaeddinegallas mentioned, checking that the certificate is valid is a good first step. Something else that I had done when investigating was to use my certificate through a different mechanism (I used the Azure Notification Hub). My certificate was working when used with Azure NH, but not when using PushSharp.

There is a thread on the Apple Developer web site on this topic:

https://devforums.apple.com/thread/224320?tstart=0

However, some of the people there are also on this thread. So the information is biased for sure. A contact that I have at Apple is saying:

While there is no official documentation out yet, it seems like APNS is moving towards TLS rather than SSL (solely based on seeing this change - I have not heard anything official).

@lukeconner

This comment has been minimized.

Copy link

lukeconner commented Apr 17, 2014

@coffeesmurf Yes, it was working up until two days ago. The certificate is definitely not expired. I will try it through the Azure notification hub and see if that works.

@Redth

This comment has been minimized.

Copy link
Owner

Redth commented Apr 17, 2014

Can't hurt to try reissuing the certificate anyway!

@edencraig

This comment has been minimized.

Copy link

edencraig commented Apr 17, 2014

Just a quick note to say thanks. I've been bashing my head against the wall for nearly 8 hours and this fix sorted all my issues!

@iMike82

This comment has been minimized.

Copy link

iMike82 commented Apr 18, 2014

@lukeconner I've had a similar problem, everything was working three days ago, then suddenly stopped. I've used the simplepush.php script from raywenderlich tutorial and it worked.
The change from ssl3 to tls didn't seem to work, but! I decided to delete all the generated/cached files from my project - i.e. the debug and obj folders from both the PushSharp.Core and .Apple solutions. I have also downloaded the newest newtonsoft.Json library and rebuild the project. Worked in my case. Maybe you should also do a "Clean solution" and then "Rebuild Solution" ?

@DYoussi

This comment has been minimized.

Copy link

DYoussi commented Apr 18, 2014

I'm having a problem accessing the Dev Sandbox on our web server.

I made the TLS change suggested above (thanks coffeesmurf!)
Accessing the production APNS works just fine from our web server.
Accessing the dev sandbox works fine from my local machine.
Accessing the dev sandbox does NOT work from our web server.

At first it gives me a Maximum number of send attempts was reached error, followed by a Received an unexpected EOF error.

pushnotificationerror

@madebysoren

This comment has been minimized.

Copy link

madebysoren commented Apr 19, 2014

I can confirm this is working. Great! Thank you very much @coffeesmurf !

@menasheu

This comment has been minimized.

Copy link

menasheu commented Apr 19, 2014

I have also been searching everything possible and regenerated all certificates, changed ssl3 to tls, rebuilt the pushsharp project, but still get the error:
Maximum number of send attempts was reached error. Does somebody still have the problem?

@lukeconner

This comment has been minimized.

Copy link

lukeconner commented Apr 19, 2014

Max number of attempts I think is a different problem.
On Apr 19, 2014 3:49 PM, "menasheu" notifications@github.com wrote:

I have also been searching everything possible and regenerated all
certificates, changed ssl3 to tls, rebuilt the pushsharp project, but still
get the error:
Maximum number of send attempts was reached error. Does somebody still
have the problem?


Reply to this email directly or view it on GitHubhttps://github.com//pull/369#issuecomment-40882734
.

@menasheu

This comment has been minimized.

Copy link

menasheu commented Apr 19, 2014

Because, like all the others, everything was working fine until a few days ago when it suddenly stopped working with no apparent reason.

@menasheu

This comment has been minimized.

Copy link

menasheu commented Apr 20, 2014

Finally rebuilt the entire project with the Tls change, reissued a new certificate, downloaded the last Newtonsoft and everything is working fine again. What a waste of time.

@sharat

This comment has been minimized.

Copy link

sharat commented Apr 21, 2014

I'm also facing maximum number of attempts issue

@gpolucci

This comment has been minimized.

Copy link

gpolucci commented Apr 21, 2014

Does anybody know if these changes are going to be released in a NuGET package soon?

@lukeconner

This comment has been minimized.

Copy link

lukeconner commented Apr 21, 2014

I had to remove the nuget package and manually add the required classes.
On Apr 21, 2014 1:52 PM, "Gerry" notifications@github.com wrote:

Does anybody know if these changes are going to be released in a NuGET
package soon?


Reply to this email directly or view it on GitHubhttps://github.com//pull/369#issuecomment-40975894
.

@menasheu

This comment has been minimized.

Copy link

menasheu commented Apr 22, 2014

I complained to Apple about the huge waste of time of probably endless people, and this is their answer....
"Thank you for contacting Apple Developer Program Support regarding issues with push notifications.
We're sorry that you did not receive prior notification as that must have been frustrating.
We appreciate that you have taken the time to send us your feedback. Your comments have been forwarded to the appropriate Apple team"

@dcudin

This comment has been minimized.

Copy link

dcudin commented Apr 23, 2014

I had "Maximum number of send attempts was reached error" problem which was desribed by @DYoussi . My tls changed code(described by @coffeesmurf) was working under windows 7 and windows 8 but it didn't work on server 2003. I discovered that apple's offical page talks about "Entrust Secure CA root certificate" which must be installed on the provider's server. I installed "entrust_2048_ca.cer" certificate to server2003 and rebooted it. After that I can send push notification to my sandbox app via microsoft server2003. You can find detailed information and "entrust_2048_ca.cer" certificate at following web pages:

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01205.0210/doc/html/aba1259709684708.html

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html

@sharat

This comment has been minimized.

Copy link

sharat commented Apr 24, 2014

For each interface, use TLS (or SSL) to establish a secured communications channel. The SSL certificate required for these connections is provisioned through the iOS Provisioning Portal. (See “Provisioning and Development” for details.) To establish a trusted provider identity, present this certificate to APNs at connection time using peer-to-peer authentication.

This is what it says in the documentation. I am wondering why still we can't use SSL.

@mrchief

This comment has been minimized.

Copy link

mrchief commented Apr 29, 2014

Changing it to TLS does work. I didn't have to re-issue certificates (YMMV). Any idea when we can get a Nuget build?

Redth added a commit that referenced this pull request May 23, 2014

Merge pull request #369 from coffeesmurf/master
Fix for APNS Sandbox notifications that were no longer working

@Redth Redth merged commit 191090c into Redth:master May 23, 2014

1 check failed

default TeamCity Build PushSharp :: PushSharp finished: Process exited with code 1; error message is logged
Details

@Bishbulb Bishbulb referenced this pull request Oct 8, 2014

Closed

An updated NuGet package #406

@velchev

This comment has been minimized.

Copy link

velchev commented Nov 18, 2014

Do you know if that fix has been added for version v2.2.1? Any updates from apple for the sandbox SSL certificate?

@Redth

This comment has been minimized.

Copy link
Owner

Redth commented Nov 18, 2014

Yes, 2.2.1 has TLS instead of SSL...

@velchev

This comment has been minimized.

Copy link

velchev commented Nov 18, 2014

Thanks for the quick reply this helped me to find what the actual problem is... I was not using p12 sandbox certificate but rather .cer sandbox certificate. With the correct certificate Pushsharp worked great!

@kriscarle

This comment has been minimized.

Copy link

kriscarle commented on 51b1944 Mar 16, 2015

Just a note, this also fixed an issue with PushSharp not running on on Windows servers that enforce FIPS compliant encryption (and means I can go back to using the Nuget build). Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.