iOS APNs问题

最近几天自己做的APNs服务器突然不能发送推送了,老是提示:
Warning: stream_socket_client(): Failed to enable crypto in /Users/y/Documents/Proj/IOSPush/production1/pushMe.php on line 21

Warning: stream_socket_client(): unable to connect to ssl://gateway.push.apple.com:2195 (Unknown error) in /Users/y/Documents/Proj/IOSPush/production1/pushMe.php on line 21
Failed to connect: 0

我是用的php做的推送,后来去MemberCenter里面去查看证书,发送证书被某个同事删掉了。后来重新申请证书,就好了。
附带php和java的证书转换命令
JAVA证书生成:
openssl x509 -in aps_production.cer -inform DER -out aps_production.pem -outform PEM
openssl pkcs12 -nocerts -out PushChat_Noenc.pem -in PushChatKey.p12
openssl pkcs12 -export -in aps_production.pem -inkey PushChat_Noenc.pem -certfile CertificateSigningRequest.certSigningRequest -name “aps_production” -out aps_production.p12

PHP证书生成:
openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
openssl pkcs12 -nocerts -out PushChatKey.pem -in Push.p12
cat PushChatCert.pem PushChatKey.pem > ck.pem

php发布:
openssl x509 -in aps_production.cer -inform der -out PushChatCert.pem
openssl pkcs12 -nocerts -out PushChatKey.pem -in Push.p12
cat PushChatCert.pem PushChatKey.pem > ck.pem

参考APNS开发链接:
http://zhang8mss.blog.163.com/blog/static/1104637562012260250222/

http://bbs.9ria.com/thread-246219-1-1.html

你可能感兴趣的:(ios,apns)