admin管理员组文章数量:1022784
We are having difficulty sending a request through a corporate proxy from our Node.JS application to DocuSign (demo.docusign and account-d.docusign)/ We've identified that the issue is possibly due to the DocuSign server accepting TLS 1.1 and 1.2 only.
Is there any way to force set the TLS version to TLS 1.2 for requests? If there are any request modules (axios, got, request) that supports this and if there are code examples it would be very helpful.
Thanks alot in advance!
We are having difficulty sending a request through a corporate proxy from our Node.JS application to DocuSign (demo.docusign and account-d.docusign.)/ We've identified that the issue is possibly due to the DocuSign server accepting TLS 1.1 and 1.2 only.
Is there any way to force set the TLS version to TLS 1.2 for requests? If there are any request modules (axios, got, request) that supports this and if there are code examples it would be very helpful.
Thanks alot in advance!
Share Improve this question asked Aug 7, 2020 at 7:04 NakakapagpabagabagHmNakakapagpabagabagHm 6331 gold badge7 silver badges14 bronze badges1 Answer
Reset to default 5You can specify the min and max TLS version to use by setting tls.DEFAULT_MAX_VERSION and tls.DEFAULT_MIN_VERSION.
This should then apply to any module that uses the core Node.js TLS code.
For example:
const axios = require("axios");
const tls = require("tls");
tls.DEFAULT_MIN_VERSION = "TLSv1.1";
tls.DEFAULT_MAX_VERSION = "TLSv1.3";
async function testTLSVersion() {
let response = await axios({ url: "https://httpbin/get"});
console.log("TLS Version of connection:", response.request.connection.getProtocol());
}
testTLSVersion();
Here we connect to an https server and log the TLS version of the connection. You can play about with the MIN and MAX TLS versions to see how it affects the protocol used.
We are having difficulty sending a request through a corporate proxy from our Node.JS application to DocuSign (demo.docusign and account-d.docusign)/ We've identified that the issue is possibly due to the DocuSign server accepting TLS 1.1 and 1.2 only.
Is there any way to force set the TLS version to TLS 1.2 for requests? If there are any request modules (axios, got, request) that supports this and if there are code examples it would be very helpful.
Thanks alot in advance!
We are having difficulty sending a request through a corporate proxy from our Node.JS application to DocuSign (demo.docusign and account-d.docusign.)/ We've identified that the issue is possibly due to the DocuSign server accepting TLS 1.1 and 1.2 only.
Is there any way to force set the TLS version to TLS 1.2 for requests? If there are any request modules (axios, got, request) that supports this and if there are code examples it would be very helpful.
Thanks alot in advance!
Share Improve this question asked Aug 7, 2020 at 7:04 NakakapagpabagabagHmNakakapagpabagabagHm 6331 gold badge7 silver badges14 bronze badges1 Answer
Reset to default 5You can specify the min and max TLS version to use by setting tls.DEFAULT_MAX_VERSION and tls.DEFAULT_MIN_VERSION.
This should then apply to any module that uses the core Node.js TLS code.
For example:
const axios = require("axios");
const tls = require("tls");
tls.DEFAULT_MIN_VERSION = "TLSv1.1";
tls.DEFAULT_MAX_VERSION = "TLSv1.3";
async function testTLSVersion() {
let response = await axios({ url: "https://httpbin/get"});
console.log("TLS Version of connection:", response.request.connection.getProtocol());
}
testTLSVersion();
Here we connect to an https server and log the TLS version of the connection. You can play about with the MIN and MAX TLS versions to see how it affects the protocol used.
版权声明:本文标题:javascript - Force setting TLS vresion 1.2 when sending out a request from Node.JS to DocuSign - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745523344a2154416.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论