问题描述
我想要实现我的应用程序推送通知,为了这个,我想基于我的Linux使用easyApns,我遵循的步骤,并实现类。但不幸的是我还是老样子博彩相关的证书一些错误。
i'm trying to implement push notification in my application, for this i tried to use easyApns, i follow the steps, and implement the classes on my linux based. but unfortunately i stil betting some errors related to certificates.
我的错误是:
警告:在stream_socket_client()[function.stream插槽客户端]:SSL
操作失败,code 1. OpenSSL的错误消息:
错误:14094416:SSL例程:SSL3_READ_BYTES:SSLv3的警报证书
在不明就/var/www/html/apns/classes/class_APNS.php线401
警告:在stream_socket_client()[function.stream插槽客户端]:
无法启用加密在/var/www/html/apns/classes/class_APNS.php
上线401
Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /var/www/html/apns/classes/class_APNS.php on line 401
警告:在stream_socket_client()[function.stream插槽客户端]:
无法连接到SSL://gateway.sandbox.push.apple.com:2195
(未知的错误)在/var/www/html/apns/classes/class_APNS.php在线
401
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /var/www/html/apns/classes/class_APNS.php on line 401
注意:无法连接到APNS:0。 1)APNS :: __构造 - >文件:
apns.php(50行)2)APNS :: _ fetchMessages - >文件:class_APNS.php
(线217)3)APNS :: _ pushMessage - >文件:class_APNS.php(376线),4)
APNS :: _ triggerError - >文件:class_APNS.php(线405)在
/var/www/html/apns/classes/class_APNS.php线509
Notice: Failed to connect to APNS: 0 . 1) APNS::__construct -> File: apns.php (line 50) 2) APNS::_fetchMessages -> File: class_APNS.php (line 217) 3) APNS::_pushMessage -> File: class_APNS.php (line 376) 4) APNS::_triggerError -> File: class_APNS.php (line 405) in /var/www/html/apns/classes/class_APNS.php on line 509
我gusse这是有关证书(.pem文件)
i gusse it's an error related to the certificate (the .pem file)
使用以下命令生成的你.pem文件WA
my .pem file wa generated using the following command
OpenSSL的PKCS12 -in APNS-DEV-cert.p12退房手续APNS-DEV-cert.pem -nodes -clcerts
和它被放置在服务器(基于Linux)上,并给出CHMOD 644权限
and it was placed on the server (linux based) and given chmod 644 privileges
我应该怎么做任何其他事情......
should i do any thing else.....
推荐答案
您可以连接到使用证书APNS?试试下面的命令来检查:
Are you able to connect to apns using your certificate? try following command to check that:
$的OpenSSL的s_client.First -connect gateway.sandbox.push.apple.com:2195 -cert YourSSLCertAndPrivateKey.pem -debug -showcerts -CAfile服务器的CA-cert.pem
如果此命令将会终止,你是不是能够连接。如果继续运行,并允许您键入插入插座,您已成功连接。
If the command terminates, you are not able to connect. If it continues running and lets you type into the socket, you have connected successfully.
这篇关于Linux下创建从pushnotification .pem文件用PHPW¯¯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!