4

given:

  • working iPod application
  • The server side in php (modified easyapns).

I'm sending requests in the sandbox ssl://gateway.sandbox.push.apple.com:2195 If I'm sending a request to ssl://gateway.push.apple.com:2195, no errors returned, but the notification did not reach. In this case if I'm sending totally wrong device token (e.g. 12345), the APNs still didn't return error.

Problem: APN returns status_code => 8 (for explanation of the docks: Invalid token) to the inquiry Enhanced notification format, and returns an error code for a 4 out of 5 tokens with 5 devices.

I have correct dev crtificate, at least so says iPod's app developer which sent that certificate to me. And the iPod's app developer argues that application is sending correct dev token each time (I don't know how to check device token without mac and developer tools).

Checked:

  • The server ports 2195,2196 are open
  • My router settings through which iPod connected to the network is correct (and port 5223 for receiving is open) - I tested on "iPusher" and "iPush test" apps
  • Connection to the APN is successful
  • Tried to send from the local machine
  • Tried to send from the VPS
  • Checked
Kara
  • 6,115
  • 16
  • 50
  • 57
gorodezkiy
  • 3,299
  • 2
  • 34
  • 42
  • Are you storing the token somewhere so that there could be some issue with that part? – Joachim Isaksson Apr 10 '12 at 15:53
  • Currently while testing it hardcoded directly in the php code. And I didn't write it, just copy/paste that which was sent to server by iPod application. – gorodezkiy Apr 12 '12 at 09:01
  • You're using the live certificate and live tokens when talking to the live APN server, right? – mattjgalloway Apr 12 '12 at 09:12
  • No, I'm using correct dev certificate, at least so says iPod's app developer which sent that certificate to me. And the iPod's app developer argues that application is sending correct dev token each time (I don't know how to check device token without mac and developer tools). You may be confused by fact that I try to request production url, but this was due to despair. – gorodezkiy Apr 13 '12 at 08:37

2 Answers2

3

When I had this problem it turned out to be because the key and cert didn't match. Try connecting using openssl:

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert cert.pem -key key.pem

Until that spews out a pile of stuff starting with 'CONNECTED' you're not connecting properly.

ostergaard
  • 3,377
  • 2
  • 30
  • 40
  • Can you clarify what sort of "pile of stuff" indicates a valid connection? – aroth Sep 06 '12 at 23:33
  • 1
    Well ... The output starts with 'CONNECTED' but then you have maybe a hundred lines of detail about the connection. When the cert and key don't match you get something like: `error setting private key 140735150221756:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:x509_cmp.c:331:` – ostergaard Sep 27 '12 at 21:06
0

We are faced with the same problem. The problem was in provision profile: it was production, but for sandbox it must be development. More description we found in This comment

Community
  • 1
  • 1
Valera Dubrava
  • 245
  • 4
  • 12