FIX: SSL proxy tunnel support with basic auth #1183
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ASIO http client fails to connect to HTTPS endpoints via an HTTP proxy for some proxy server implementations, when using HTTP basic-auth for the connection to the proxy.
When connecting to an endpoint via an
ssl_proxy_tunneland using basic-auth for the proxy authentication, we experienced problems with certain proxy servers. Usingprivoxyeverything worked fine, howevertinyproxydidn't work.After munching through quite a bit of Wireshark we figured out that the
CONNECT ... HTTP/1.1request to the proxy was terminated by\r\n\r\n\r\n. I.e. one too many\r\n.Some proxy implementations seem to drop this extra CRLF. Some others (e.g.
tinyproxy) sent the extra CRLF as the first two bytes of payload to the endpoint. Obviously this screwed up the TLS handshake that was following.It's fairly easy to reproduce this issue using the
bing_requestexample. Just add the following to its proxy configuration and make it talk tohttpS://www.bing.com: