Closed voiddrum closed 2 months ago
Looks similar to https://github.com/aws/aws-sdk-ruby/issues/2339
So the feature request is to not overwrite the Host
header if the request already has one.
It's unusual that this is needed at the AWS4Signer level. You can override the endpoint at the client level with a custom EndpointConfiguration
but I guess you can't use this.
As a workaround, you can use a RequestHandler2
to change the endpoint to the hostname you want.
https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/handlers/RequestHandler2.html
Just a heads up, the team is focused in working in features for the Java SDK v2, so this has a low chance to be implemented.
This is weird of AWS4Signer to set host as endpoint .
StringBuilder hostHeaderBuilder = new StringBuilder(endpoint.getHost());
Due to this unable to access AWS service that are running behind NLB .
We don't have plans to support this in v1 before going into Maintenance Mode, so I'll go ahead and close this issue.
The recommendation is to migrate to Java SDK v2. If this issue is still relevant in v2, please open new Github issue in the v2 repo and provide all the details.
This issue is now closed.
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Describe the feature
As of now, AWS4Signer extracts host name from end point url and uses it to set the
Host
header and compute hash to sign the request.Ideally, if a host name is provided in the request's
Host
header, AWS4Signer should use that instead.Use Case
In cases where the target host is behind a load balancer/gateway, the final host name will be that of the host which hosts the API (Eg: AWS Neptune
/sparql
API).Clients should be able to set the target host name in header in order for the target host to verify the request.
Proposed Solution
If a host name is provided in the request's
Host
header, AWS4Signer should use that instead of extracting from endpoint url.Other Information
awscurl
command line tool is able to honour the host header. eg: The below invocation worksAcknowledgements
AWS Java SDK version used
1.11.1009
JDK version used
11.0.16.1
Operating System and version
MacOS Ventura 13.3.1 (22E261)