SSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报意外消息 [英] SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message
问题描述
我正在使用 restler 进行休息调用.我对 https://google.com 的其余调用进行了测试并得到了预期的响应.现在我正在尝试调用另一个 url 位置,但是出现以下错误消息:SSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报意外消息:openssl\ssl\s23_clnt.c:741:
I am using restler, for making rest calls. I tested and got an expected response for the rest call to https://google.com. Now I am trying to make a call to another url location, but there is the following error message: SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert unexpected message:openssl\ssl\s23_clnt.c:741:
我对相同的 url 使用 curl 得到了预期的响应(url 与此处不同,因为我无法共享它.对此很抱歉).
I got the expected response using curl for the same url(url is different from here since I cannot share it. Sorry about that).
我还尝试了另一个 rest 客户端,如本链接,但得到相同的错误消息.
I also tried another rest client as in this link, but get the same error message.
是否与站点的证书有关,因为两种情况下使用的 SSL 版本都是 SSLv3_method.
Is it to do with the certificates of the sites, since the SSL version used in both the cases is SSLv3_method.
我正在使用以下代码进行其余调用:
I am using the following code for making the rest call:
'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);
}
});
};
如果有人可以向我提供他们的宝贵意见,那将是非常有帮助的.谢谢.
It will be of great help if some one can provide me with their valuable inputs. Thanks.
推荐答案
我遇到了同样的问题,通过添加
I had the same problem, solved it by adding
secureProtocol: 'SSLv3_method'
到 node_modules/restler/lib/restler.js line:82 处的restler.request 如下所示:
to the restler.request at node_modules/restler/lib/restler.js line:82 as shown below:
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
});
这篇关于SSL 例程:SSL23_GET_SERVER_HELLO:sslv3 警报意外消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!