4
votes

On my server (Debian 3.2.54-2 x86_64 GNU/Linux), I use this command to check the connection with APNS (Apple Push Notification Server):

telnet gateway.sandbox.push.apple.com 2195
Trying 17.172.232.46...
Trying 17.172.232.45...
Trying 17.172.232.18...
telnet: Unable to connect to remote host: Connection timed out
ping gateway.sandbox.push.apple.com
PING gateway.sandbox.push-apple.com.akadns.net (17.172.232.46) 56(84) bytes of data.

The telnet failed to help me connect. What is the reason for that?

1) Do I need to ask the admin to configure the firewall to let the telnet go through the port 2195?

2) When we use a telnet to a server with a given port, what port on our side will be open?

 telnet gateway.sandbox.push.apple.com 2195 
means the port 2195 on APNS will be opened, so which port on our computer will be open to establish the connection?
1
have you found an answer? - tomermes
i have the same problem; it seems the server at Apple is not responding gateway.sandbox.push.apple.com - Andrei Diaconescu

1 Answers

0
votes

Use OpenSSL and pass a valid certificate, for testing purposes you can use a self-signed certificate, for example, to create the pair key and crt:

$ openssl req -x509 -newkey rsa:2048 -sha256 -nodes -keyout example.key -out example.crt -subj "/CN=example.com" -days 10

Then to create the cert.pem

$ cat example.key example.crt > cert.pem

Later you can test with:

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

This will connect and do the handshake but you will get verification errors something like:

CONNECTED(00000006)
...
verify error:num=20:unable to get local issuer certificate