Skip to content

Conversation

SamRemis
Copy link
Contributor

@SamRemis SamRemis commented Oct 17, 2025

This PR includes a bugfix which breaks signing any requests that are sent to a non-default port.

Problem:

There's a mismatch between the host header used for signing vs. the actual request header when connecting to non-default ports.

During signing: The host header includes port (from URI netloc) and gets added to signed headers. The header does not get added to the final request.
During request creation: The host header excludes port (from URI host) if not already present.
Result: The request is signed with example.com:8080 but sent with the host header having a value of example.com. This creates a signature validation issue server-side.

Solution:

This PR updates the CRT client to use netloc, similar to the signer. These values should always match if a given HTTP client is compliant with the HTTP RFCs.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@SamRemis SamRemis requested a review from a team as a code owner October 17, 2025 19:49
@SamRemis SamRemis force-pushed the bugfix-sign-with-netloc branch from 25c7c09 to 2b60ae6 Compare October 22, 2025 20:33
@SamRemis SamRemis merged commit cb012c0 into smithy-lang:develop Oct 22, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants