IIS 服务器上 PHP 的 Apple 推送通知服务

发布于 2024-10-21 14:47:24 字数 1112 浏览 4 评论 0原文

我使用 PHP 脚本成功从 apache Web 服务器发送了推送通知。然后我将完整的代码和html传输到IIS。尝试发送推送通知后,我收到以下警告:

Warning (2): stream_socket_client() [http://php.net/function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages:
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure [APP\controllers\push_notifications_controller.php, line 79]Code | Context$text   =   "test from hugh"
$apnsHost   =   "gateway.sandbox.push.apple.com"
$apnsPort   =   2195
$apnsCert   =   "../vendors/certificate.pem"
$streamContext  =   resource
$error  =   0
$errorString    =   ""stream_socket_client - [internal], line ??
PushNotificationsController::__send_push_notification() - APP\controllers\push_notifications_controller.php, line 79
PushNotificationsController::index() - APP\controllers\push_notifications_controller.php, line 58
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
require - APP\webroot\index.php, line 83
[main] - CORE\index.php, line 55

我认为certificate.pem 文件或IIS 处理ssl 的方式有问题。你能帮忙吗?

I successfully sent push notification from apache web server with PHP script. Then I have transferred the complete code and html to IIS. After trying to send the push notification, I get following warning:

Warning (2): stream_socket_client() [http://php.net/function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages:
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure [APP\controllers\push_notifications_controller.php, line 79]Code | Context$text   =   "test from hugh"
$apnsHost   =   "gateway.sandbox.push.apple.com"
$apnsPort   =   2195
$apnsCert   =   "../vendors/certificate.pem"
$streamContext  =   resource
$error  =   0
$errorString    =   ""stream_socket_client - [internal], line ??
PushNotificationsController::__send_push_notification() - APP\controllers\push_notifications_controller.php, line 79
PushNotificationsController::index() - APP\controllers\push_notifications_controller.php, line 58
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
require - APP\webroot\index.php, line 83
[main] - CORE\index.php, line 55

I think that something is wrong with the certificate.pem file, or the way IIS is handling ssl. Could you please help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紅太極 2024-10-28 14:47:24

您首先需要确保防火墙上的端口(2195 和 2196)已打开。

另外: Error using PHP for iPhone APNS <-- 说这是一个证书有问题..

You first need to ensure that the ports (2195 and 2196) on the firewall are open.

Also: Error Using PHP for iPhone APNS <-- said it was a problem with the certificate..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文