无法连接到live'sssl://gateway.push.apple.com:2195'

Iff*_*ffi 6 push-notification apple-push-notifications apns-php

我在IOS设备上遇到推送通知的APNS php代码问题,我有两个独立的开发和生产连接.

  1. 我已经在我的服务器上配置了开发连接,通过添加.pem文件证书和Passphares它的工作完美,我也收到了通知.看看我的开发配置:

网址:'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();
Run Code Online (Sandbox Code Playgroud)

问题:

  1. 比我通过添加以下参数配置生产连接但我收到连接错误:

网址: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();
Run Code Online (Sandbox Code Playgroud)

连接错误: 信息:尝试ssl://gateway.push.apple.com:2195 ...错误:无法连接到'ssl://gateway.push.apple.com:2195':( 0)信息:重试连接(1/3)...信息:尝试ssl://gateway.push.apple.com:2195 ...错误:无法连接到'ssl://gateway.push.apple.com:2195 ':( 0)INFO:重试连接(2/3)...信息:尝试ssl://gateway.push.apple.com:2195 ...错误:无法连接到'ssl://网关. push.apple.com:2195':( 0)信息:重试连接(3/3)...信息:尝试ssl://gateway.push.apple.com:2195 ...错误:无法连接到'ssl://gateway.push.apple.com:2195':( 0)

我谷歌问题,我发现了一些解决方案,我已经检查了一切,一切都很好但没有成功.

  • 我使用了正确的开发和生产途径.
  • 我为两者创建了单独的证书.pem文件,并在推送应用程序上测试了证书.证书是正确的.
  • 端口也很好,我的服务器没有阻塞,因为在开发URL和开发服务器推送通知中使用相同的端口工作正常.

真的很感激任何帮助.提前致谢.

Iff*_*ffi 5

我为推送通知创建的证书(.pem)有问题。

解决方案: 经过几天的尝试,我发现创建带有迷你字符密码的证书可能是1234,它将非常适合您并成功连接到IOS推送通知服务器。

也许这会帮助别人。

谢谢。

  • 我这样固定的。使用“ $ openssl pkcs12 -in cert.p12 -out pushcert.pem -nodes -clcerts”命令生成pem。当它询问“ passpharess”时,我没有给出任何“ passpharess”。只需单击Enter。并使用“ http://apns-gcm.bryantan.info/”进行了测试。希望它会帮助某人。 (2认同)