【问题标题】:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected messageSSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报意外消息
【发布时间】:2014-03-26 14:42:11
【问题描述】:

我正在使用restler 来拨打休息电话。我对https://google.com 的其余呼叫进行了测试并得到了预期的响应。现在我正在尝试调用另一个 url 位置,但出现以下错误消息: SSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报意外消息:openssl\ssl\s23_clnt.c:741:

我使用 curl 对同一个 url 得到了预期的响应(url 与此处不同,因为我无法共享它。对此感到抱歉)。

我还尝试了另一个 REST 客户端,如 link,但得到相同的错误消息。

是不是和网站的证书有关,因为这两种情况下使用的SSL版本都是SSLv3_method。

我正在使用以下代码进行其余调用:

   'use strict';
   module.exports = function (app) {
   app.get('/preference', function (req, res) {
        res.render('preference', {});
   });

    var rest = require('restler');

    rest.get('https://testlink/v1/path').on('complete', function(result) {
      if (result instanceof Error) {
        console.log('Error:', result.message);
      } else {
        console.log(result);
      }
    });

    };

如果有人可以向我提供他们宝贵的意见,那将是非常有帮助的。谢谢。

【问题讨论】:

    标签: node.js rest ssl kraken.js


    【解决方案1】:

    我遇到了同样的问题,通过添加解决了它

    secureProtocol: 'SSLv3_method'
    

    到 node_modules/restler/lib/restler.js line:82 处的 restler.request 如下所示:

    this.request = proto.request({
       host: this.url.hostname,
       port: this.url.port,
       path: this._fullPath(),
       method: this.options.method,
       headers: this.headers,
       rejectUnauthorized: this.options.rejectUnauthorized,
       secureProtocol: 'SSLv3_method'   //<---- add this
    

    });

    【讨论】:

      猜你喜欢
      • 2011-10-12
      • 2016-04-27
      • 2015-12-02
      • 2016-12-12
      • 2016-05-04
      • 2019-12-21
      • 2016-05-01
      • 1970-01-01
      相关资源
      最近更新 更多