node.js - SSL 例程 :SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message

标签 node.js rest ssl kraken.js

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

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

我还尝试了另一个休息客户端,如 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);
      }
    });

    };

如果有人能向我提供他们宝贵的意见,那将会有很大的帮助。谢谢。

最佳答案

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

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

});

关于node.js - SSL 例程 :SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22467826/

相关文章:

ssl - Fiddler https 错误 : "because they do not possess a common algorithm"

mysql - 在不登录的情况下检查MySQL服务器是否启用了ssl

带有自签名 SSL 证书的 iOS MKTileOverlay

javascript - 使用 Twitter API 发推文时出现重复状态错误

node.js - 在 Node-red 仪表板中显示普通图表或 D3J(通过模板?)

node.js - 同时运行 React 和 Node。

api - RESTful API设计最佳实践

rest - paypal rest api更新存储的信用卡

node.js - 如何管理 RESTful API 的权限

javascript - 如何在 Electron 渲染的网页上调用 JavaScript 函数?