dongyu4908 2019-01-13 13:55
浏览 338

无法连接到APN:无法连接:tls://gateway.sandbox.push.apple.com:2195:2(stream_socket_client():无法设置本地证书链文件

Problem

I have searched extensively trying to resolve this issue of trying to run push notifications from laravel, using https://github.com/laravel-notification-channels/apn.

Here is my configuration for the apns within broadcasting.php:

apn => [
            'environment' => \NotificationChannels\Apn\ApnChannel::SANDBOX, // Or ApnChannel::SANDBOX
            'certificate' => base_path('ApnsDev.pem'),
            'pass_phrase' => 'MY_PASSWORD', // Optional passPhrase
 ],

Here is the error I keep continously getting from the bash:

NotificationChannels\Apn\Exceptions\ConnectionFailed : Cannot connect to APNs: Unable to connect: tls://gateway.sandbox.push.apple.com:2195: 2 (stream_socket_client(): Unable to set local cert chain file `C:\Users\Dell\la ravel-backend\aps_development.cer'; Check that your cafile/capath settings include details of your certificate and its issuer)

at C:\Users\Dell\laravel-backend\vendor\laravel-notification-channels\apn\src\Exceptions\ConnectionFailed.php:16 12| * @return \NotificationChannels\Apn\Exceptions\ConnectionFailed 13| */ 14| public static function create($exception) 15| {

16| return new static("Cannot connect to APNs: {$exception->getMessage()}", 0, $exception); 17| } 18| } 19|

Exception trace:

1
NotificationChannels\Apn\Exceptions\ConnectionFailed::create(Object(ZendService\Apple\Exception\RuntimeException)) C:\Users\Dell\laravel-backend\vendor\laravel-notification-channels\apn\src\InteractsWithConnection.php:32

2 ZendService\Apple\Exception\RuntimeException::("Unable to connect: tls://gateway.sandbox.push.apple.com:2195: 2 (stream_socket_client(): Unable to set local cert chain file `C:\Users\Dell\laravel-backend\aps_development .cer'; Check that your cafile/capath settings include details of your certificate and its issuer)") C:\Users\Dell\laravel-backend\vendor\zendframework\zendservice-apple-apns\src\Apns\Client\AbstractClient.php:113

Please use the argument -v to see more details.

Please help! We are so close on getting our app out but just need to be able to send push notifications, we are able to generate device tokens from the ionic cordova frontend but without the laravel backend being able to send the notification then we're kind of in a rut then.

Sources That Don't Work

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 C#读写EXCEL文件,不同编译
    • ¥15 如何提取csv文件中需要的列,将其整合为一篇完整文档,并进行jieba分词(语言-python)
    • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
    • ¥15 扩散模型sd.webui使用时报错“Nonetype”
    • ¥15 stm32流水灯+呼吸灯+外部中断按键
    • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
    • ¥15 NX MCD仿真与博途通讯不了啥情况
    • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
    • ¥15 gradio的web端页面格式不对的问题
    • ¥15 求大家看看Nonce如何配置