By not specifying a protocol, the following block will result in an HTTPS server that uses TLS 1.2:
var options = {
key: fs.readFileSync("security/server.key"),
cert: fs.readFileSync("security/server.crt")
};
https.createServer(options, app).listen(443);
However, one of my endpoints needs to act as a subscriber endpoint for the Fitbit API, which requires TLS 1.0. To do this, I need to set secureProtocol
to TLSv1_method
.
var options = {
key: fs.readFileSync("security/server.key"),
cert: fs.readFileSync("security/server.crt"),
secureProtocol: "TLSv1_method" // Fitbit subscription API requires TLS 1.0
};
https.createServer(options, app).listen(443);
What would be the best way to use TLS 1.0 for one endpoint and TLS 1.2 for all others? The answer may lie in the http-proxy module, but I'm having a hard time applying the documentation to my use case. Note that I am using different subdomains to differentiate the traffic.