Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(net): don't stop the server when an SSL handshake fails with EOF
HttpAcceptor::accept()'s HTTPS logic passes IO errors from the underlying SSL stream directly to the caller. Furthermore, the caller uses the EndOfFile error code to detect that the server should stop accepting connections. This means that if the TCP connection was succesfully accepted, but an EOF condition was detected during the handshake, the server will stop accepting connections and quit. This allows for a trivial denial of service attack and can happen accidentally as well. Change HttpAcceptor::accept such that if the TCP stream underlying the SSL stream returns an IoError error, a ConnectionAborted IoError is returned instead. This allows distinguishing between IoErrors from the acceptor and the stream. The original error reason is stored in the detail field.
- Loading branch information