-
Notifications
You must be signed in to change notification settings - Fork 859
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
S3TransferManager CRT AsyncClient does not set port in Host
header when using endpointOverride
#3682
Comments
@poconnor-lab49 thank you for reaching out. We and the CRT Team will work on a fix. |
We have released a fix. Could you try with the latest version? Feel free to re-open if you continue to see the issue. |
|
@zoewangg Thanks! This is working for me. Could I request an update to the docs though? The changelog says the CRT client is now generally available, so https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/crt-based-s3-client.html is out of date. I'm also not clear on what the difference is between using S33AsyncClient.crtBuilder() vs the advice from https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/http-configuration-crt.html S3AsyncClient.builder()
.httpClientBuilder(AwsCrtAsyncHttpClient
.builder()
.connectionTimeout(Duration.ofSeconds(3))
.maxConcurrency(100))
.build() except that I get a warning from the second style from the
|
@poconnor-lab49 good call out, we will clarify in the docs what's the difference between the two. I don't know what you mean by the S3 CRT client page being out of date though, could you elaborate? And yes, S3TransferManager multipart upload/download is supported only when the CRT-based S3 client is used: S33AsyncClient.crtBuilder() |
Describe the bug
The S3TransferManager does not include the port in the
Host
header when using theS3AsyncClient.crtBuilder()
and setting an endpointOverride.Expected Behavior
The endpoint port is included in the
Host
header if it is not the default for the protocol.Wireshark
Current Behavior
The CRT client does not set the port from the endpoint override.
The legacy client sets the port correctly.
wireshark
Log
Reproduction Steps
Run localstack in docker compose:
Create a bucket
Try to PUT and GET an object
Possible Solution
Maybe something is broken in https://github.com/awslabs/aws-c-http or https://github.com/awslabs/aws-crt-java ?
Additional Information/Context
Used dependencies as described in https://aws.amazon.com/blogs/developer/introducing-crt-based-s3-client-and-the-s3-transfer-manager-in-the-aws-sdk-for-java-2-x/
SDK: 2.19.12
CRT: 0.21.0
This can be worked around using a proxy to add the port to the header. See localstack/localstack#7449 (comment) for an example.
Possibly related:
Tangentially related and maybe in the wrong repo:
NO_PROXY
environment variable awslabs/aws-c-http#413AWS Java SDK version used
2.19.12
JDK version used
openjdk version "17.0.5" 2022-10-18
Operating System and version
slackware-current
The text was updated successfully, but these errors were encountered: