-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for CONNECT proxy in Cro::HTTP::Client #127
Comments
This may be related to #116 |
For (largely my,) reference for a CONNECT proxy the client will send |
I think what has to happen is that there needs to be a third type of connector that connects to the proxy, issues the |
Okay, I have a working PoC that's good enough for my current purposes:
Obviously some work needs to be done to abstract the connect part and I think the Connector wants to go somewhere else other than in |
I think the connector probably wants to in cro-core as |
And just in case anyone wants to reproduce/test this, I used |
I tried @jonathanstowe 's code and it works with my proxy too(#116). Although I deleted codes related to |
FWIW I'd be quite happy to make a PR for the above, but I'd probably want some guidance as to where as I'm not sure it wants to be where I've put it in the PoC. |
Has anyone had any thoughts about this? I'm kinda warnocked on what PR should be provided. (BTW the above code has been used in a production application since March without any problems.) |
is this issue related to Cro::HTTP::Client doing http request to https website when using an https proxy ?
|
Yes, that's likely the same thing. Basically with a "classic" HTTP proxy as implemented by Cro::HTTP::Client the client makes a network connection to the proxy, and then issues the (e.g.) GET with the fully qualified URI of the target resource - you can see it doing that in your trace. With a CONNECT proxy connection, which most modern proxy software implements as it deals better with secure connections, the client makes the network connection to the proxy, then issues a The Connector hack above definitely works, I've been using it in production code for a year and half, the only reason I've not made a PR with it is that I'm not entirely where it should be applied so probably need some guidance. |
For HTTPS proxied requests if the proxy doesn't have the CA certificate for the target server (irrespective of whether the client has,) when using the same request method then it may fail, which is why the CONNECT method is used to the proxy host for HTTPS. Most proxy implementations require this these days.
The text was updated successfully, but these errors were encountered: