Skip to content
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

How to parse Proxy-Authorization in HTTPS requests ? #123

Open
0x13A0F opened this issue Jul 31, 2024 · 3 comments
Open

How to parse Proxy-Authorization in HTTPS requests ? #123

0x13A0F opened this issue Jul 31, 2024 · 3 comments

Comments

@0x13A0F
Copy link

0x13A0F commented Jul 31, 2024

Hi
I'm working on a proxy based on hudsucker, and im pretty new to Rust. the first thing i wanna do is make proxy authorization work, it does work fine with HTTP, but with HTTPS it's different, since there is a CONNECT request done first, so when the actual request go through, the header is dropped, is there anything builtin in hudsucker or Rust to handle this issue properly ?

@omjadas
Copy link
Owner

omjadas commented Aug 1, 2024

I think you will need to instead return a 407 in response to the CONNECT, rather than trying to do it in response to an HTTPS request.

@0x13A0F
Copy link
Author

0x13A0F commented Aug 2, 2024

i don't get it, what's the point of returning 407 ? I made it work by checking if it's CONNECT then saving the proxy-authorization header. but somehow it doesn't work in the browser, the header is not there at all

@omjadas
Copy link
Owner

omjadas commented Aug 2, 2024

I assumed you would want to return a 407 if the client hasn't properly authenticated themselves. The browser won't include the proxy-authorization header for HTTPS requests because in a typical setup they would not be visible to a proxy server, which is why any checks you want to do should be on the CONNECT request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants