2

I'm trying to test the connection between my server & Apple's sandbox APNS server with the following command:

$ openssl s_client -connect gateway.sandbox.apple.com:2195 -cert cert.pem -key key.pem
Enter pass phrase for key.pem:
gethostbyname failure
connect:errno=0

What is the meaning of gethostbyname failure, and what is the cause?

In the same server, telnet to port 2195 is working fine:

$ telnet gateway.push.apple.com 2195
Trying 17.149.36.242...
Connected to gateway.push-apple.com.akadns.net.
Escape character is '^]'.

UPDATE: If I use IP instead of host name, it works fine:

$ openssl s_client -connect 17.149.36.242:2195 -cert cert.pem -key key.pem

OpenSSL is unable to resolve DNS ?

1 Answer 1

7

The correct name for sandbox is gateway.sandbox.push.apple.com, not gateway.sandbox.apple.com.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi Eran, i used openssl s_client –connect gateway.sandbox.push.apple.com:2195 -cert my_cert.pem -key my_cert.pem but i also get same error gethostbyname failure connect:errno=0 .. im new too iOS & push notiifcation.. plz provide helpful links or code snippets :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.