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

20,494

Solution 1

Thanks for help, so far I solved the solution.

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

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

Thanks!

Solution 2

In case of MAC, (built-in server was working fine using terminal but not through browser, for me, so i installed MAMP.)

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

2 go to terminal-->$open /private/etc-->go to--->apache2>originals>httpd.config file--> **"#LoadModule php5_module libexec/apache2/libphp5.so", remove "#"..(perhaps, you would have to change the permission also..!)

then goto browser and check--> localhost/yourPhpFile.php

In Case of Windows system,

1.Install WAMP,

2.goto php.ini file--->search for this ";extension=php_openssl.dll" line and remove semicolon ";".

3.click WAMP icon from right-bottom goto PHP>PHP Extensions>select php_openssl..

That's it..hope this may help further seekers.

Solution 3

  1. if you are getting an error like this "Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?" then follow the next step

  2. if php has not got ssl enabled then goto php.ini and change this to ";extension=php_openssl.dll" "extension=php_openssl.dll" (remove the semicolon) and save it and run the program.

Share:
20,494
Rico Chan
Author by

Rico Chan

I like programing very much, now being a entrepreneur of an IT company. Although my experience is just few years, I would like to practice practice and practice to make perfect.

Updated on June 03, 2020

Comments

  • Rico Chan
    Rico Chan almost 4 years

    I sucessfully run the APNS code in my macbook air, but it turns out that I can not run it in my other computer:

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

    The computers can not work are:

    Windows 7,XAMPP,OpenSSL supported,No firewall

    And

    EC2 Linux server with 2195 and 2196 opened

    What might be other issues causing that I got this error in my php code?

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

    I know there might be cause by not opening SSL, but I checked the phpInfo(), it 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 in 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 '^]'.
    
  • Rico Chan
    Rico Chan about 11 years
    i have updated my description, the ".pem" file is the same, will it cause the problem?
  • Rico Chan
    Rico Chan about 11 years
    In the php info, there are: openssl OpenSSL support enabled OpenSSL Library Version OpenSSL 1.0.1c 10 May 2012 OpenSSL Header Version OpenSSL 0.9.8x 10 May 2012
  • Rico Chan
    Rico Chan about 11 years
    So is there any method? If you want more information, please let me to find~ I really want to solve this.
  • Mickey
    Mickey almost 11 years
    I got the same problem. Can you share more information of "root cert" and "my cert"? I upload the production and development PEM file of push notification.
  • inVINCEable
    inVINCEable about 9 years
    I have no web server folder on my mac