Failed to connect to 'ssl: //gateway.sandbox.push.apple.com: 2195'

I successfully run APNS code in my macbook mode, but it turns out that I cannot run it on another computer:

I checked that they are the same: 1..pem file (specific) 2. Program

Computers cannot work:

Windows 7, XAMPP, OpenSSL, without a firewall

and

EC2 Linux server with open 2195 and 2196

What could be other problems causing an error in my php code?

Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195' 

I know there may be a reason not opening SSL, but I checked phpInfo (), this should be correct.

 openssl OpenSSL support enabled OpenSSL Library Version OpenSSL 1.0.1c 10 May 2012 OpenSSL Header Version OpenSSL 0.9.8x 

I tried telnet on EC2 server, it gives:

 telnet gateway.push.apple.com 2195 Trying 17.149.36.239... Connected to gateway.push-apple.com.akadns.net. Escape character is '^]'. 
+8
php apache openssl apple-push-notifications
source share
3 answers

Thanks for the help, so far I have decided the solution.

The problem is that I used the same pem file for my certificate and root certificate.

There is a root certificate that is different from my own certificate, both certificates are used during the connection, so I have to get the root certificate of the apple button notification.

Thanks!

+1
source share

In the case of MAC (the embedded server worked fine using the terminal, but not through the browser, for me, so I installed MAMP.)

1.Go to ---> / Library / WebServer / Documents / ---- copy both php and ckdev. pem here.

2 go to terminal$ open / private / etc → go to ---> apache2> originals> httpd.config file → ** "# LoadModule php5_module libexec / apache2 / libphp5.so" , delete " # " .. (maybe , you will also need to change the resolution ..!)

then go to the browser and check -> localhost / yourPhpFile.php

In the case of a Windows system ,

1. Install WAMP ,

2.goto php.ini file ---> find the line " ; extension = php_openssl.dll " and delete the semicolon " ; ".

3.click the WAMP icon on the right side of goto PHP> PHP Extensions> select php_openssl ..

What is it ... I hope this can help further seekers.

+2
source share
  • if you get this error: "Unable to find ssl socket transfer" - did you forget to enable it when you configured PHP? "and then follow the next step

  • if php did not get ssl enabled, then goto php.ini and changed it to "; extension = php_openssl.dll" "extension = php_openssl.dll" (delete the semicolon) and save it and run the program.

+1
source share

All Articles