我正在使用 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/