Conversation
This fixes an issue where TLS clients that cleanly close connections part-way through a handshake (e.g. node 12 TLS clients) did not trigger a tlsClientError.
|
Just wanted to highlight that this is different to #10, in that this change only disables half-open sockets for TLS connections, and leaves plain HTTP untouched. Afaict your comment there is only half correct, and HTTPS servers don't actually set |
|
+1 |
|
@mscdex anything I can do to help get this merged? It's a clear difference in behaviour between httpolyglot & https.Server, and it'd be really useful to have it fixed so that |
I'm trying to detect clients rejecting my HTTPS certificate, using httpolyglot.
With the current httpolyglot server, if a client cleanly closes a TLS connection after the server hello (i.e. when it decides it doesn't like the certificate), the current httpolyglot never fires a
tlsClientErrorevent, whilsthttps.Serverdoes.I've hit this because that's the behaviour of Node 12 TLS clients - they cleanly close connections at this point (in Node 10, the handshake completes,
secureConnectionfires, and then the client closes the connection without sending any data - that works fine).The below test demonstrates the issue. I haven't committed it, because it only works with Node 12, but hopefully it shows what I'm talking about.
This appears to happen because httpolyglot allows half-open TLS connections, whilst
https.Serverdoes not. As far as I can tell half-open connections are only allowed by default onhttp.Server, so I've changed the code here to disable it on sockets once we know that they are definitely TLS.With this change, the above test passes.