php - 无法连接到 APN:无法连接:tls://gateway.sandbox.push.apple.com:2195: 2 (stream_socket_client(): 无法设置本地证书链文件
问题描述
问题
我进行了广泛的搜索,试图解决这个试图从 laravel 运行推送通知的问题,使用https://github.com/laravel-notification-channels/apn。
这是我在 broadcasting.php 中的 apns 配置:
apn => [
'environment' => \NotificationChannels\Apn\ApnChannel::SANDBOX, // Or ApnChannel::SANDBOX
'certificate' => base_path('ApnsDev.pem'),
'pass_phrase' => 'MY_PASSWORD', // Optional passPhrase
],
这是我不断从 bash 中得到的错误:
NotificationChannels\Apn\Exceptions\ConnectionFailed:无法连接到 APNs:无法连接:tls://gateway.sandbox.push.apple.com:2195: 2 (stream_socket_client(): 无法设置本地证书链文件`C:\ Users\Dell\la ravel-backend\aps_development.cer'; 检查您的 cafile/capath 设置是否包含您的证书及其颁发者的详细信息)
在 C:\Users\Dell\laravel-backend\vendor\laravel-notification-channels\apn\src\Exceptions\ConnectionFailed.php:16 12| * @return \NotificationChannels\Apn\Exceptions\ConnectionFailed 13| */ 14| 公共静态函数 create($exception) 15| {
16| return new static("无法连接到 APNs: {$exception->getMessage()}", 0, $exception); 17| } 18| } 19|
异常跟踪:
1
NotificationChannels\Apn\Exceptions\ConnectionFailed::create(Object(ZendService\Apple\Exception\RuntimeException)) C:\Users\Dell\laravel-backend\vendor\laravel-notification-channels\apn\src\InteractsWithConnection.php: 322 ZendService\Apple\Exception\RuntimeException::("无法连接: tls://gateway.sandbox.push.apple.com:2195: 2 (stream_socket_client(): 无法设置本地证书链文件`C:\Users \Dell\laravel-backend\aps_development .cer'; 检查您的 cafile/capath 设置是否包括您的证书及其颁发者的详细信息)") C:\Users\Dell\laravel-backend\vendor\zendframework\zendservice-apple-apns \src\Apns\Client\AbstractClient.php:113
请使用参数 -v 查看更多详细信息。
请帮忙!我们即将推出我们的应用程序,但只需要能够发送推送通知,我们能够从 ionic cordova 前端生成设备令牌,但没有 laravel 后端能够发送通知,那么我们就可以了一个车辙。
不工作的来源
解决方案
推荐阅读
- android - 使用bounding box时不显示地图;setScrollableAreaLimitDouble
- android - 查询结果是延迟设置应用程序变量
- c# - 驱动程序为空,不知道出了什么问题。Selenium C#:控制台应用程序 (.Net Core 2.0)
- node.js - Bash - 可以安装列出的 npm 全局包的输出命令
- javascript - 将外部 javascript 注入 html 脚本标签以获得 cobertura 代码覆盖结果
- javascript - 如何从 WKWebView Swift 调用这个 javascript 函数?
- database - 如何为 Npgsql 准备好的语句提供一组以上的数据?
- sql - 如何根据参数中的过滤器值隐藏行
- react-native - 添加方法以创建StackNavigator
- javascript - node.js:嵌套函数样式代码比 ES6 类样式有害吗?