APN php code giving Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195

谁都会走 提交于 2019-11-27 23:22:48

Assuming your server has the right ports open, "Connection Refused" usually hints at an invalid .PEM file or an incorrect passphrase. Make sure that when you open the .PEM file, the header looks something like this :

Bag Attributes
friendlyName: Apple Development IOS Push Services: com.yourapp.app
localKeyID: A8 77 BC 0C 2E 81 10 6E 78 9F XX XX XX XX XX XX

subject=/UID=com.yourapp.app/CN=Apple Development IOS Push Services: com.yourapp.app/C=FR issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority

followed by a key which should then be followed by a header that looks like this for your private key :

Bag Attributes
friendlyName: Joe Black
localKeyID: A8 77 BC 0C 2E 81 10 6E 78 9F XX XX XX XX XX XX XX XX
Key Attributes: <No Attributes>

I suggest you also remove the passphrase to reduce the potential error sources.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!