苹果推送通知服务

苹果推送通知服务

我尝试使用本地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认证,

所以我完全困惑我现在要做的事情。

请让我知道在本地运行它需要做什么

最佳答案

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

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


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

关于php - 苹果推送通知服务,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1481443/

10-10 17:43