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

Proxy-Support header case sensitive causes proxied API failure when using HttpClient #61414

Closed
ChrisFWood opened this issue Nov 10, 2021 · 4 comments · Fixed by #61446
Closed
Assignees
Milestone

Comments

@ChrisFWood
Copy link
Contributor

I've been looking into an issue where access to a API work via PowerShell but doesn't via HttpClient.

The diagnostic output logs "Proxy doesn't support connection-based auth" and looking it to that appear to be proxy requires the header "Proxy-Support" with the value "Session-Based-Authentication".

However the API in question has the "Proxy-Support" with the value "Session-based-authentication" a simple case change. While I can accept the specification for the proxy support header may specify the value with an exact case, following this means dotnet apps will not work with some API, and other implementations do not enforce the casing.

Suggested fix would be to make the check case insensitive.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Net.Http untriaged New issue has not been triaged by the area owner labels Nov 10, 2021
@ghost
Copy link

ghost commented Nov 10, 2021

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

Issue Details

I've been looking into an issue where access to a API work via PowerShell but doesn't via HttpClient.

The diagnostic output logs "Proxy doesn't support connection-based auth" and looking it to that appear to be proxy requires the header "Proxy-Support" with the value "Session-Based-Authentication".

However the API in question has the "Proxy-Support" with the value "Session-based-authentication" a simple case change. While I can accept the specification for the proxy support header may specify the value with an exact case, following this means dotnet apps will not work with some API, and other implementations do not enforce the casing.

Suggested fix would be to make the check case insensitive.

Author: ChrisFWood
Assignees: -
Labels:

area-System.Net.Http, untriaged

Milestone: -

@geoffkizer
Copy link
Contributor

RFC here: https://datatracker.ietf.org/doc/html/rfc4559

As you can see, it's rather brief and doesn't actually say whether the value is case sensitive or not.

Since there are servers out there that seem to assume it's case-insenstive, we should probably do the same.

@ChrisFWood
Copy link
Contributor Author

I don't appear to be able to assign myself to this but I don't mind creating a pull request for this.

ChrisFWood added a commit to ChrisFWood/runtime that referenced this issue Nov 11, 2021
RFC4559 does not specify that the Proxy-Support header value used to
determine if the proxy server will honour client server authentication
integrity is case sensitive. Updating the check to be case insensitive
to prevent failures when value is supplied using differences in case.

Fix dotnet#61414
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Nov 11, 2021
@karelz karelz added this to the 7.0.0 milestone Nov 11, 2021
@karelz karelz added bug and removed untriaged New issue has not been triaged by the area owner labels Nov 11, 2021
karelz pushed a commit that referenced this issue Nov 23, 2021
RFC4559 does not specify that the Proxy-Support header value used to
determine if the proxy server will honour client server authentication
integrity is case sensitive. Updating the check to be case insensitive
to prevent failures when value is supplied using differences in case.

Fix #61414
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Nov 23, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2021
github-actions bot pushed a commit that referenced this issue Dec 13, 2022
RFC4559 does not specify that the Proxy-Support header value used to
determine if the proxy server will honour client server authentication
integrity is case sensitive. Updating the check to be case insensitive
to prevent failures when value is supplied using differences in case.

Fix #61414
carlossanlop pushed a commit that referenced this issue Jan 5, 2023
RFC4559 does not specify that the Proxy-Support header value used to
determine if the proxy server will honour client server authentication
integrity is case sensitive. Updating the check to be case insensitive
to prevent failures when value is supplied using differences in case.

Fix #61414

Co-authored-by: Christopher Wood <chris@thetoxiczone.com>
@karelz karelz modified the milestones: 7.0.0, 6.0.x Jan 6, 2023
@karelz
Copy link
Member

karelz commented Jan 6, 2023

Fixed in 7.0 in PR #61446 and in 6.0.14 in PR #79620.

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

Successfully merging a pull request may close this issue.

3 participants