I am making HTTPS connections from a host application using a client certificate:
var options = {
hostname: 'https://my-server.com',
port: 443,
path: '/',
method: 'GET',
key: fs.readFileSync('client1-key.pem'),
cert: fs.readFileSync('client1-crt.pem'),
ca: fs.readFileSync('ca-crt.pem') };
var req = https.request(options, res => {
[...]
});
Everything works fine, however I want to add code to allow only TLS 1.2 connections. I cannot find a way to configure this in the https.agent options or elsewhere. Is it possible to configure this, or do I need to establish a connection and then request the protocol version , for example:
res.socket.getProtocol() === 'TLSv1.2'
and abort if the protocol is not satisfactory?
source
share