jeudi 8 janvier 2015

Troubleshooting APNS from AWS (Amazon Linux). Same code works fine from Ubuntu 14.04

Everything used to work fine, but went down a couple weeks ago. No changes to the server, some changes to the app, but I have eliminated them from suspicion by successfully sending pushes from my development server.


Used simple PHP push code to send test messages. Copied code and certificate to Amazon and I get error "Failed to connect: 0"


I used the sample PHP code found all over the web, like here


Troubleshooting using Apples Technical Note TN2265 and found openssl s_client command. I think that is working fine. It prints a bunch of what looks like tcpdump output, with the final message of:



$ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert myKeyFile.pem -debug -showcerts -CAfile entrustKeyFile

Start Time: 1420775697
Timeout : 300 (sec)
Verify return code: 0 (ok)


I can then type some characters and hit enter to see:



jwefwekj
jwefwekj
write to 0x718690 [0x7221c3] (53 bytes => 53 (0x35))
0000 - 17 03 02 00 30 c2 a1 2c-24 b6 60 7e 6b 7c 0c e3 ....0..,$.`~k|..
0010 - fa 2d b8 ff 6f 00 8b ba-b7 25 ad 2f 38 34 0c 70 .-..o....%./84.p
0020 - 46 4f 0d 5c fb d8 c2 a1-83 3c 23 dc 95 f8 a6 29 FO.\.....<#....)
0030 - ac f4 3f 72 0b ..?r.
read from 0x718690 [0x71dc73] (5 bytes => 5 (0x5))
0000 - 15 03 02 00 30 ....0
read from 0x718690 [0x71dc78] (48 bytes => 48 (0x30))
0000 - 52 97 c4 13 42 b7 a8 38-29 dc c2 e3 cc 26 29 78 R...B..8)....&)x
0010 - 36 9a 09 f9 c0 ff ff ba-30 ee a9 03 b9 aa 18 9b 6.......0.......
0020 - cb d3 bc 84 89 0f 67 4a-47 0b 4e bd f3 d2 bc 48 ......gJG.N....H
closed
write to 0x718690 [0x7221c3] (53 bytes => 53 (0x35))
0000 - 15 03 02 00 30 0f e6 90-3d b8 ac db 73 e2 dc 28 ....0...=...s..(
0010 - 3b 75 aa 25 9d 93 5c 6b-91 c5 75 cb d2 f9 41 1a ;u.%..\k..u...A.
0020 - ba 64 06 da e4 7e 74 c1-f9 57 bf 0d 84 2a 80 72 .d...~t..W...*.r
0030 - 2e 19 d3 ed 0a .....


I didn't see any error messages as I've found with googling for this issue. If this connects, I think my cert is fine and my firewall is fine. I'm at a loss about where to troubleshoot next. Can anyone point me in the right direction?





Aucun commentaire:

Enregistrer un commentaire