推送通知连接错误
我正在使用 php 脚本在我的应用程序上推送通知。但在下面的行中
$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);"
,
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem');
我收到如下错误:
警告:stream_socket_client():SSL 操作失败,代码为 1。
OpenSSL 错误消息: 错误:14094416:SSL 例程:SSL3_READ_BYTES:第 29 行 /Users/amit/Desktop/NotificationFolder/apns.php 中的 sslv3 警报证书未知警告:stream_socket_client():无法在第 29 行 /Users/amit/Desktop/NotificationFolder/apns.php 中启用加密
警告:stream_socket_client():无法连接到第 29 行 /Users/amit/Desktop/NotificationFolder/apns.php 中的 ssl://gateway.sandbox.push.apple.com:2195(未知错误)
连接失败0
有谁知道如何解决这个问题吗? 除此之外一切都运行良好。
I'm using php script for pushing notification on my application. But on following line
$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);"
where
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem');
I get an error as follows:
Warning: stream_socket_client(): SSL operation failed with code 1.
OpenSSL Error messages:
error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown in /Users/amit/Desktop/NotificationFolder/apns.php on line 29Warning: stream_socket_client(): Failed to enable crypto in /Users/amit/Desktop/NotificationFolder/apns.php on line 29
Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /Users/amit/Desktop/NotificationFolder/apns.php on line 29
Failed to connect 0
Do any one know how to get rid of this problem??
Beside it everything works fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的证书密码是什么,是否正确给出,您的证书是否真的在 ck.pem 中找到?您是如何创建证书的?
what's your certificate password, is it given correctly and is you certificate really found in ck.pem ? How did you create your certificate?