我有一个节点 js 应用程序在 Azure AMS 上作为移动服务运行。我一直在使用请求库对外部服务器进行 HTTPS 获取/发布 api 调用。直到几天前,当外部实体决定停止支持 TLS 1.0 及更低版本时,一切都可以正常工作。
我想知道是否有人知道 Azure AMS 阻止/失败 TLS 1.1/1.2 与外部主机通信的任何已知问题?该主机使用由 DigiCert 颁发的有效 SSL 证书。
在我的代码中,我已经尝试了几件事来明确告诉 nodejs 使用 TLS 1.1 / 1.2,但这没有用。
var httpRequest = require("request"),
https = require('https');
https.globalAgent.options.secureProtocol = 'TLSv1_2_method'; // Instructing to use TLS 1.2
....
httpRequest.post('https://external-api-url.com', {
'json': true,
'body': params,
'timeout': 20000,
'jar': false,
'headers': {
"Arr-Disable-Session-Affinity": true
}
}, function(err, response, body) {
// Code to handle response.
});
除了 globalAgent,我还尝试从 agentOptions 以及直接从 options 对象中设置 secureProtocol。这些方法都不起作用。
任何帮助将不胜感激。
谢谢。