joyent/node — pull request #6466 by indutny (2013-11-05 14:18:31+00:00)
Title: tls: more accurate wrapping of connecting socket

When socket, passed in `tls.connect()` `options` argument is not yet
connected to the server, `_handle` gets assigned to a `net.Socket`,
instead of `TLSSocket`.

When socket is connecting to the remote server (i.e. not yet connected,
but already past dns resolve phase), derive `_connecting` property from
it, because otherwise `afterConnect()` will throw an assertion.

fix #6443

Suggested reviewer: @isaacs, @piscisaureus or @bnoordhuis?