-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Proxy authentication not recognized in macOS #86322
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionI'm using HttpClient to open an URI, like this: I setup a proxy using environment variables http_proxy/https_proxy=http://user:pass@server:port Reproduction StepsSample app:
Set environment variables:
Expected behaviorConnection is successful and we get the console output: Actual behaviorRegression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
Can you post packet captures @olivepedro? And would it work if you set the proxy explicitly using https://learn.microsoft.com/en-us/dotnet/api/system.net.webproxy?view=net-7.0? That code is same as on Linux so I don't see reason why this should behave any different. |
This issue has been marked |
This issue has been automatically marked |
Hello To find the root cause we switch in java to make the same test and we also get a 407 return code.
Have we got the same restriction in dotnet ? Best regards |
Do you know what scheme is used in successful case? You can create CredentialCache and using it instead of credentials. But that does not work with the environment - you would need to set WebProxy explicitly and pass the cache to is as credentials. |
The code used for testing |
right. so instead of |
Now that works also with the Non System Proxy, thanks ! But finally we try to use the proxy implementation provided by Environment variables by switching on the System proxy and we make :
|
what i see in source code It's a NetworkCredential that is used ! |
I don't understand the last comment @grazius. The environment syntax does not allow to specify authentication scheme. So either the proxy needs to clearly indicate what it supports or it is going to fail. It is difficult to make guesses without actually seeing the exchange. |
Hello
It's just to say that the HttpEnvironmentProxy code use a NetworkCredential where in my "Non System proxy" implementation i need to use a CredentialCache... So i'm not surprised that the return code is 407 when we try to use environment variable to specify the proxy.
What our corporate proxy does not indicate clearly that make the authentication fail with proxy define as environment variable ? Best regards |
The And what .NET version do you use? #887 was fixed in 6.0 so it should work if you use recent versions. |
With credentials provided in the environment variable
I use net7.0 locally |
and HttpClient? |
Yes regarding the code previously provided
|
The question was not about code but what does it sends on wire.... |
Hello
So dotnet try to use the Negociate only I also added try catch
|
To complete, on our Mac Workstation we've got Kerberos to interact with our Active Directory. When using HttpEnvironmentProxy:
Best regards |
The Note that There was some discussion and insight in #82547 |
Our corporate proxy is used for internet access so i think it's normal that it present the Negociate Auth scheme before the Basic. But here i use a dotnet application (this application is ArtifactTool developed internally by Microsoft). The only way today i found to make this tool working is to had a mitmproxy without authentication that call our corporate proxy with the Basic auth ... But it's really a workaround. What i don't understand here is our proxy work with java, python, a simple curl ... but not with dotnet core :( So they're is a no way to force the authentication scheme to Basic ? Best regards |
There is way but you need to do it explicitly and not via environment. |
No evolution can be planned to allow this case ? |
I feel this is corner case - this did not come up so far e.g. this is first instance. If anything you should figure out what the |
This issue has been automatically marked |
This issue will now be closed since it had been marked |
Description
I'm using HttpClient to open an URI, like this:
HttpResponseMessage response = httpClient.GetAsync("https://www.microsoft.com/").Result;
I setup a proxy using environment variables http_proxy/https_proxy=http://user:pass@server:port
In Windows and Ubuntu, I can successful connect to the proxy. In macOS, I get the error:
Reproduction Steps
Sample app:
Set environment variables:
Expected behavior
Connection is successful and we get the console output:
Actual behavior
an exception is thrown:
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: