There is a bug introduced in 0.6.7 (specifically, by 07c27e0) that causes double 'error' events to be emitted by https requests where the connection is refused.
Test case: https://gist.github.com/1623151
What seems to happen is that the socket error is propagated up to the http layer, which responds by trying to destroy the ClearTextStream. As of the commit referenced above, when destroy is called on the SecurePair, if the connection has not been established it emits an error. This logic seems broken. I'm not sure, but I think the best approach is to do one of two things:
tls: fix double 'error' events on HTTPS Requests
Can someone review koichik/node@fcdf2d0?
@koichik: fcdf2d0 LGTM. Thanks for the quick fix.
@bnoordhuis - Thanks for your review, merging.
@russellhaering - Thanks for the report, fixed in 534df2f.