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

HttpClient doesn't support proxy server in HTTPS protocol in Linux #102441

Open
ms-hujia opened this issue May 20, 2024 · 3 comments
Open

HttpClient doesn't support proxy server in HTTPS protocol in Linux #102441

ms-hujia opened this issue May 20, 2024 · 3 comments
Labels
area-System.Net.Http documentation Documentation bug or enhancement, does not impact product or test code help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@ms-hujia
Copy link
Contributor

From the document of HttpClient, I saw below description:

The proxy server may be a hostname or IP address, optionally followed by a colon and port number, or it may be an http URL, optionally including a username and password for proxy authentication. The URL must be start with http, not https, and cannot include any text after the hostname, IP, or port.

I'm wondering if this is a platform specific limitation due to underlying stack, or it's due to some historical consideration which's gone away now. As using proxy server secured by HTTPS is common in customer's corpnet, could you help to evaluate if it's possible to support proxy server in HTTPS protocol by Linux? It's really frustrating as other clients/scripts written by Golang, Python, Ruby and curl could well support this scenario.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label May 20, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@MihaZupan MihaZupan added the documentation Documentation bug or enhancement, does not impact product or test code label May 20, 2024
@MihaZupan
Copy link
Member

Looks like our docs are outdated here. HTTPS proxy support was added in .NET 8.0: #87638

The scheme may also be socks4, socks4a or socks5.

@MihaZupan MihaZupan added this to the Future milestone May 20, 2024
@MihaZupan MihaZupan added help wanted [up-for-grabs] Good issue for external contributors and removed untriaged New issue has not been triaged by the area owner labels May 20, 2024
@ms-hujia
Copy link
Contributor Author

Thanks for the information, Miha!

I've verified the different behavior of dotnet 7 and dotnet 8:

For dotnet 7, the HTTP request will succeed but it doesn't go through the proxy server in HTTPS protocol.

For dotnet 8, the HTTP request will succeed, and it goes through the proxy server and secured by TLS.

Hope above behaviors could be updated in the public document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net.Http documentation Documentation bug or enhancement, does not impact product or test code help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

No branches or pull requests

2 participants