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.