PuTTY semi-bug http-proxy-auth-wsaenotconn

This is a mirror. Follow this link to find the primary PuTTY web site.

Home | FAQ | Feedback | Licence | Updates | Mirrors | Keys | Links | Team
Download: Stable · Snapshot | Docs | Privacy | Changes | Wishlist

summary: HTTP proxy authentication can fail with "Socket is not connected" on Windows
class: semi-bug: This might or might not be a bug, depending on your precise definition of what a bug is.
absent-in: 0.76
present-in: 0.77

We've had reports that, since 0.77, attempting to use PuTTY on Windows to connect via an HTTP proxy that requires authentication can fail, possibly intermittently, with the message "Network error: Socket is not connected".

This appears to have been triggered by the overhaul of PuTTY's HTTP proxy implementation in 0.77 to add features such as Digest authentication and interactive prompting, combined with the behaviour of certain proxy servers.

Since 0.77, when PuTTY first connects to an HTTP proxy server, it initially doesn't attempt to send credentials at all, even if it has them; this is intended to elicit a "407 Proxy Authentication Required" response from the server if needed, along with Proxy-Authenticate header(s) telling PuTTY which authentication methods the server will accept. PuTTY will then try again, this time providing credentials using the best available authentication method.
(Previously, PuTTY would have eagerly sent any credentials it had as plaintext HTTP Basic authentication right at the start, as that's all it knew how to do; but that's no longer appropriate.)

Some proxy servers choose to close the HTTP connection immediately after telling the client the supported authentication methods (Connection: close). (A proxy server from "Bluecoat" is one such.) In this situation, PuTTY immediately opens a fresh connection to the proxy server, intending to send the credentials this time.

We've reproduced the reported failure; what goes wrong next appears to be entirely within the client machine (and not a problem with the behaviour of the proxy server):

We're not sure how this isn't a bug in the Windows sockets API. We haven't yet thought of how to work around it.


If you want to comment on this web site, see the Feedback page.
Audit trail for this semi-bug.
(last revision of this bug record was at 2025-07-22 13:22:46 +0100)