aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

CRT client configuration feature parity

Open pwinckles opened this issue 2 years ago • 7 comments

Describe the feature

The CRT client should have feature parity with the old client builder. Specifically, the CRT builder does not currently allow you to specify S3Configuration or modify the client to trust all certificates.

For example, the following is not possible with the CRT client:

S3AsyncClient.builder()
        .endpointOverride(URI.create(S3_MOCK.getServiceEndpoint()))
        .region(Region.US_EAST_2)
        .credentialsProvider(
                StaticCredentialsProvider.create(AwsBasicCredentials.create("foo", "bar")))
        .serviceConfiguration(S3Configuration.builder().pathStyleAccessEnabled(true).build())
        .httpClient(NettyNioAsyncHttpClient.builder().buildWithDefaults(AttributeMap.builder()
                .put(TRUST_ALL_CERTIFICATES, Boolean.TRUE)
                .build()))
        .build();

Use Case

These configuration options are needed for supporting S3 mock implementations.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

AWS Java SDK version used

2.19.8

JDK version used

17.0.4

Operating System and version

Fedora 36

pwinckles avatar Jan 07 '23 13:01 pwinckles

Hi @pwinckles, I have some questions about your request.

When you say:

The CRT client should have feature parity with the old client builder.

Which old client builder are you referring to?

Which features specifically are you asking for in the CRT client, is it pathStyleAccessEnabled and the ability to support TRUST_ALL_CERTIFICATES? Also, are you using the CRT client in the S3TransferManager?

debora-ito avatar Jan 09 '23 23:01 debora-ito

Which old client builder are you referring to?

The builders for the non-CRT sync/async clients, like the one in my example.

Which features specifically are you asking for in the CRT client, is it pathStyleAccessEnabled and the ability to support TRUST_ALL_CERTIFICATES?

For me personally, I would like path-style access and the ability to trust all certs, with the former being more important than the later. However, it would seem to me that it would be good for the builders to offer as similar of configuration options as possible.

Also, are you using the CRT client in the S3TransferManager?

Yes, I started updating a library to use the transfer manager, and noticed that it's only worth while to do so if you use it with the CRT client. However, the CRT client does not support the same configuration options.

pwinckles avatar Jan 10 '23 00:01 pwinckles

the environment variable disableCertChecking could be added as in previous versions, as requested in this ticket https://github.com/aws/aws-sdk-java-v2/issues/1230

mvillafuertem avatar Feb 25 '23 08:02 mvillafuertem

Path style access is an important flag for us because our integration tests and local development setup rely on it.

fatih-celonis avatar Mar 02 '23 14:03 fatih-celonis

I found this issue by searching for "CRT path style access". +1 for needing that in a test environment.

chrisrhut avatar Mar 20 '23 17:03 chrisrhut

additionally it would be nice if the crt client could support metrics publishers in the ClientOverrideConfiguration, it seems to be specifically blocked at the moment https://github.com/aws/aws-sdk-java-v2/blob/master/services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/crt/DefaultS3CrtAsyncClient.java#L325-L327

StephenFlavin avatar Apr 11 '23 14:04 StephenFlavin

Isn't it fixed by this https://github.com/aws/aws-sdk-java-v2/issues/3817 ?

campidelli avatar Jun 16 '23 05:06 campidelli

  • I see in the doc as belows on v2:
The following system properties no longer supported: 
`com.amazonaws.sdk.disableCertChecking`,
 `com.amazonaws.sdk.enableDefaultMetrics`, 
`com.amazonaws.sdk.enableThrottledRetry`,
 `com.amazonaws.regions.RegionUtils.fileOverride`,
 `com.amazonaws.regions.RegionUtils.disableRemote`, 
`com.amazonaws.services.s3.disableImplicitGlobalClients`, 
`com.amazonaws.sdk.enableInRegionOptimizedMode`
  • it is ok in aws-sdk-java v1 version: class file: com.amazonaws.SDKGlobalConfiguration https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/SDKGlobalConfiguration.java

image

so, if the aws-sdk-java v1 version will not support until December 31, 2025, why over 5 years not finish this? image

I see the first issue is on year 2019. image

What is the plan, or it will never support on sdk, if already have methods(I did not see.), Please provide a way to use.

aaawuanjun avatar Nov 15 '24 07:11 aaawuanjun