DataSync - Provided HttpClient not used in default sts client
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 51
Description
Okay, so I think this is a bug, because it doesn't make a lot of sense.
I need to use proxy, so when creating DataSyncAsyncClient I'm providing my custom httpClient, where I set proxy configuration.
I'm also using WebIdentityTokenFileCredentialsProvider. Code is something like that:
```
DataSyncAsyncClient.builder()
.httpClient(NettyNioAsyncHttpClient.builder()
.proxyConfiguration(ProxyConfiguration.builder()
...)
...)
.credentialsProvider(WebIdentityTokenFileCredentialsProvider.create())
.build();
```
Now the problem is that later, somewhere down the line, the `DefaultStsClient` is created beneath, but it doesn't use the proxy settings at all.
I had to do a workaround of setting program arguments like `http(s).proxy(Host, Port, Set)` - those seem to be respected across sdk.
But I would really prefer not to do that, because of a couple of reasons, which aren't that important here.
An additional issue, I think, is that created `DataSyncAsyncClient` uses a sync `DefaultStsClient` client beneath, while everything in my configuration is async.
I'd expect the http client that I'm passing to be used, including it being async + the configuration that I've set. Alternatively, just provide my own implementation of StsClient to DataSyncAsyncClient.
I'm running aws sdk version `2.15.69` on mac `Catalina 10.15.7` running on java `graalvm-ce-java11-20.3.0` but I encounter the same issue running it on rhel with openjdk 11.
Contributor guide
Assessment
This issue has not been assessed yet.