繁体   English   中英

Apple推送通知服务

[英]Apple Push Notification Service

我试图使用本地mac机器运行,但出现以下错误

Warning: stream_socket_client() [function.stream-socket-client]: Unable to set private key file `/Applications/XAMPP/xamppfiles/htdocs/apns/apns-dev.pem’ in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 9

Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 9

Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 9

Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 9

Warning: socket_close() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 11

Warning: fclose() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 12

我从其他机器获得了PEM认证,

所以我现在完全不知所措。

请告诉我在localhost中运行它需要做什么

我认为您可能已导出证书,但不是Apple提供的.cer文件中的私钥。

来自markbates的这些说明可能会有所帮助:

从Apple获得应用程序的证书后,将您的密钥和Apple证书导出为p12文件。 以下是有关如何执行此操作的快速演练:

  1. 单击Keychain Access中证书旁边的显示箭头,然后选择证书和密钥。
  2. 右键单击并选择“ Export 2 items…
  3. 从下拉列表中选择p12格式,并将其命名为cert.p12

现在将p12文件转换为pem文件:

$ openssl pkcs12 -in cert.p12 -out apple_push_notification_production.pem -nodes -clcerts

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM