You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform: Linux 3.19.0-77-generic Update README.md #85~14.04.1-Ubuntu SMP Mon Dec 5 11:19:02 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Subsystem: https
When making an https request to a nodejs server over https, it is completing the request even though a tls handshake timeout is occurring. This was not the case in nodejs v5.7.0 but is happening v6.9.4 and v7.4.0 To see this, save the following as testServer.js
const https = require("https");
const pem = require("pem");
const express = require("express");
const constants = require("constants");
var app = express();
pem.createCertificate({
days : 60,
selfSigned : true,
commonName : "*.com"
}, function (err, keys) {
if (!err) { return startHttpsServer(keys); }
console.warn(err.message);
});
function startHttpsServer(keys) {
app.get("/cert", function (req, res) {
res.send(keys.certificate + "\n");
});
var httpsServer = https.createServer({
key : keys.serviceKey,
cert : keys.certificate,
ca : keys.ca,
secureProtocol : "SSLv23_method",
secureOptions : constants.SSL_OP_NO_SSLv3,
handshakeTimeout : 1
}, app);
httpsServer.on("clientError", function (exception, tlsSocket) {
console.log(exception);
});
httpsServer.listen(4433);
}
Note the handshakeTimeout is set to 1ms.
nodejs v5.7.0 (works as expected)
Start server by nvm exec v5.7.0 node testServer.js
$ nvm exec v6.9.4 node testServer.js
Running node v6.9.4 (npm v3.10.10)
Error: TLS handshake timeout
at TLSSocket._handleTimeout (_tls_wrap.js:556:22)
at TLSSocket.g (events.js:291:16)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket.Socket._onTimeout (net.js:339:8)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
Even though the server gets the TLS handshake timeout, the request still succeeds and the https request is serviced.
The text was updated successfully, but these errors were encountered:
mscdex
added
https
Issues or PRs related to the https subsystem.
tls
Issues and PRs related to the tls subsystem.
labels
Jan 27, 2017
I don't know what commit is responsible for the change between v5.x and v6.x (but if I had to guess: either #8805 or #8889) but the logic is currently that:
When making an https request to a nodejs server over https, it is completing the request even though a tls handshake timeout is occurring. This was not the case in nodejs v5.7.0 but is happening v6.9.4 and v7.4.0 To see this, save the following as testServer.js
Note the handshakeTimeout is set to 1ms.
nodejs v5.7.0 (works as expected)
Here is the output from the server:
nodejs v6.9.4 or v7.4.0 (does not work as expected)
Here is the output from the server:
Even though the server gets the TLS handshake timeout, the request still succeeds and the https request is serviced.
The text was updated successfully, but these errors were encountered: