【问题标题】:CERT_UNTRUSTED Error Response from Amazon SNS from Node.js来自 Node.js 的 Amazon SNS 的 CERT_UNTRUSTED 错误响应
【发布时间】:2015-03-09 00:20:06
【问题描述】:

我正在使用 sns-mobile 向 Amazon SNS 注册移动设备。我在使用 nodejs 的 SNS 推送通知上关注了 this tutorial

创建 SNS 对象的代码如下所示:

var myApp = new SNS({
    platform: SNS.SUPPORTED_PLATFORMS.ANDROID,
    region: 'eu-west-1',
    apiVersion: '2010-03-31',
    accessKeyId: config.sns.key_id,
    secretAccessKey: config.sns.secret_key_id,
    platformApplicationArn: config.sns.arn
});

本例中注册/添加用户或设备的代码如下:

// Add the user to SNS
myApp.addUser(deviceId, null, function(err, endpointArn) {
    // SNS returned an error
    if(err) {
        console.log(err);
        return res.status(500).json({
            status: 'error occurred registering device'
        });
    }

    // Tell the user everything is ok
    res.status(200).json({
        status: 'ok'
    });
});

记录到控制台的错误如下:

{ [Error: CERT_UNTRUSTED]
  message: 'CERT_UNTRUSTED',
  code: 'NetworkingError',
  region: 'eu-west-1',
  hostname: 'sns.eu-west-1.amazonaws.com',
  retryable: true,
  time: Sun Mar 08 2015 17:13:44 GMT-0700 (US Mountain Standard Time),
  statusCode: undefined }

我试着四处寻找可能发生这种情况的原因,但不断有人声称这是 nodejs 的问题。

任何想法如何解决这个问题?

【问题讨论】:

    标签: node.js amazon-web-services push-notification cordova-plugins amazon-sns


    【解决方案1】:

    问题出在节点 v0.10.34 (Node.js) 上。这应该在 v0.10.35 中得到修复。

    changelog: 2014.12.22, Version 0.10.35 (Stable)
    
    tls: re-add 1024-bit SSL certs removed by f9456a2 (Chris Dickinson)
    

    解决方案: 升级到node 0.10.35

    【讨论】:

      【解决方案2】:

      我对 SES 也有同样的问题。我最终不得不使用节点 v0.10.33(这是在 2014 年 12 月)。所以,如果你最近才更新,我会使用以前的版本,直到错误解决。

      (GitHub 上关于该问题的一些对话可能会有所帮助...https://github.com/joyent/node/issues/8894

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-08-01
        • 2016-05-13
        • 1970-01-01
        • 2021-03-29
        • 1970-01-01
        • 2019-02-14
        相关资源
        最近更新 更多