docker/docker — pull request #9442 by icecrime (2014-12-02 02:17:52+00:00)
Title: Fix client-side HTTP hijacking over TLS

Properly `CloseWrite()` the client socket once done with stdin when using TLS connection (this used to rely on an erroneous type assertion).

Fixes #8658.
Fixes #8642.

Just to give more elements for reviewers:
* Contrary to what the issues seem to indicate, this is *not* a v1.3 regression: it has most likely always existed but was made obvious to boot2docker users in v1.3 because TLS was enabled by default.
* The type assertion covered `net.TCPConn` and `net.UnixConn` but was missing a case for `tls.Conn`: we now use an unnamed interface to check for a `CloseWrite` method (which is all that matters here).
* Unfortunately, `tls.Conn` does not provide a `CloseWrite` method while the underlying connection does: we have to use a modified implementation of `tls.Dial` providing *both* the TLS and underlying connections, which allows us to implement `CloseWrite`.