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

I ran into a problem with the APNS php code for push notification on iOS devices. I have two separate connections for development and production.

  • I configured the development connection on my server by adding the .pem and Passphares file certificate that it works fine and I received a notification. Check out my development configuration:

URL: 'ssl: //gateway.sandbox.push.apple.com: 2195'

$push = new ApnsPHP_Push(
    ApnsPHP_Abstract::ENVIRONMENT_SANDBOX,
    'APNS_Dev_ISAS.pem'
);
$myNewLogger = new MyNewLogger();
$push->setLogger($myNewLogger);

// Set the Provider Certificate passphrase
$push->setProviderCertificatePassphrase('1234567');

$push->setRootCertificationAuthority('APNS_Dev_ISAS.pem');
$push->connect();

Question:

  1. How did I configure the connection for Production by adding the following parameters, but I get a connection error:

URL: ssl: //gateway.push.apple.com: 2195

$push = new ApnsPHP_Push(
    ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION,
    'APNS_PROD_ISAS.pem'
);
$myNewLogger = new MyNewLogger();
$push->setLogger($myNewLogger);

// Set the Provider Certificate passphrase
$push->setProviderCertificatePassphrase('12345678');

$push->setRootCertificationAuthority('APNS_PROD_ISAS.pem');
$push->connect();

: INFO: ssl://gateway.push.apple.com: 2195... : 'ssl://gateway.push.apple.com: 2195': (0) INFO: (1/3)... INFO: ssl://gateway.push.apple.com: 2195... : 'ssl://gateway.push.apple.com: 2195 ': (0) INFO: (2/3)... INFO: ssl://gateway.push.apple.com: 2195... : 'ssl://gateway.push.apple.com: 2195': (0) INFO: (3/3)... INFO: ssl://gateway.push.apple.com: 2195... : 'ssl://gateway.push.apple.com: 2195': (0)

google , , , , .

  • .
  • .pem pusher. .
  • , . URL- .

. .

+4
2

(.pem), - push-.

: , , , - passpharess 1234, IOS.

, - .

.

+3

, PHP script. "cafile", "CN_match" "ciphers".

. , .

$contextOptions = array(
'ssl' => array(
    'verify_peer' => false, // You could skip all of the trouble by changing this to false, but it WAY uncool for security reasons.
//    'cafile' => 'NiteVisionWebPushFile.pem',
//    'CN_match' => 'gateway.push.apple.com', // Change this to your certificates Common Name (or just comment this line out if not needed)
  //  'ciphers' => 'HIGH:!SSLv2:!SSLv3',
    'disable_compression' => true,
));
0

Source: https://habr.com/ru/post/1613288/


All Articles