Skip to content

Commit

Permalink
Disable proxies.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmagnu committed Dec 29, 2024
1 parent e06cadd commit 319fedd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/src/main/java/org/gorpipe/s3/driver/S3SourceProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
@AutoService(SourceProvider.class)
public class S3SourceProvider extends StreamSourceProvider {

private static final boolean USE_CRT_CLIENT = Boolean.parseBoolean(System.getProperty("gor.s3.client.crt", "true"));
private static final boolean USE_ASYNC_CLIENT = Boolean.parseBoolean(System.getProperty("gor.s3.client.async", "false"));
private static final boolean USE_CRT_CLIENT = Boolean.parseBoolean(System.getProperty("gor.s3.client.crt", "false"));
private static final boolean USE_ASYNC_CLIENT = Boolean.parseBoolean(System.getProperty("gor.s3.client.async", "true"));

private final Cache<String, S3Client> clientCache = CacheBuilder.newBuilder()
.expireAfterAccess(1, TimeUnit.HOURS)
Expand Down Expand Up @@ -149,6 +149,10 @@ private S3Client createCrtClient(Credentials cred) {
proxyConfig.host(proxy);
proxyConfig.port(Integer.parseInt(port));
httpClientBuilder.proxyConfiguration(proxyConfig.build());
} else {
final var proxyConfig = ProxyConfiguration.builder();
proxyConfig.useEnvironmentVariableValues(false);
httpClientBuilder.proxyConfiguration(proxyConfig.build());
}

builder.httpClientBuilder(httpClientBuilder);
Expand Down Expand Up @@ -263,9 +267,14 @@ private S3AsyncClient createNettyClient(Credentials cred) {
if (proxy != null && port != null) {
log.info("RDA AWS connection - Proxy set to {}:{}", proxy, port);
final var proxyConfig = software.amazon.awssdk.http.nio.netty.ProxyConfiguration.builder();
proxyConfig.scheme("http");
proxyConfig.host(proxy);
proxyConfig.port(Integer.parseInt(port));
httpClientBuilder.proxyConfiguration(proxyConfig.build());
} else {
final var proxyConfig = software.amazon.awssdk.http.nio.netty.ProxyConfiguration.builder();
proxyConfig.useEnvironmentVariableValues(false);
httpClientBuilder.proxyConfiguration(proxyConfig.build());
}

builder.httpClientBuilder(httpClientBuilder);
Expand Down

0 comments on commit 319fedd

Please sign in to comment.