Skip to content
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

Unable to connect to local Minio server when a proxy configuration is specified, even when the Minio server host is set in the http.nonProxyHosts. #5179

Open
armlesshobo opened this issue May 3, 2024 · 0 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@armlesshobo
Copy link

Describe the bug

With an async client built with the following code, ...

S3AsyncClient.crtBuilder()
                .httpConfiguration(
                    S3CrtHttpConfiguration.builder()
                        .proxyConfiguration(
                            S3CrtProxyConfiguration.builder()
                                .build()
                        )
                        .build()
                )
                .credentialsProvider(credProvider)
                .region(region)
                .endpointOverride(endpointUri) // URI.create("http://10.193.72.200:9000")
                .build(); 

and with the following JVM properties set:

 -Dhttp.proxyHost=10.193.0.95  -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=10.193.72.200

I cannot connect to an S3 service running on the local network, despite setting the http.nonProxyHosts property

Expected Behavior

I expect to be able to connect to both an S3 service running on the local network, as well as to AWS S3, when HTTP proxy settings are provided as JVM options.

Current Behavior

It appears the HTTP request is being sent through the proxy, instead of being sent through the local network.

I see this in the log:

software.amazon.awssdk.core.exception.SdkClientException: Failed to send the request: Proxy-based connection establishment failed because the CONNECT call failed

Reproduction Steps

Run a local instance of minio and set up a region/bucket/access key in the WebUI.

Build a client with the following code:

var asyncClient = S3AsyncClient.crtBuilder()
                .httpConfiguration(
                    S3CrtHttpConfiguration.builder()
                        .proxyConfiguration(
                            S3CrtProxyConfiguration.builder()
                                .build()
                        )
                        .build()
                )
                .credentialsProvider(credProvider)
                .region(region)
                .endpointOverride(endpointUri) // URI.create("<your_minio_server_host>:<port>")
                .build(); 

run the program with these JVM options:

 -Dhttp.proxyHost=10.193.0.95  -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=<your_minio_server_host>

(It actually doesn't matter if the http.proxyHost is set to a real HTTP proxy host, because we shouldn't be going through it anyway.)

Perform any action with that client. I tried to list buckets in my test.

        try {
            asyncClient.listBuckets().get()
                    .buckets()
                    .forEach(bucket -> logger.info("--> {}", bucket.name()));
        } catch (Exception ex) {
            logger.error("Unable to list available buckets: {}", ex.getMessage());
        }

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.23.3

JDK version used

openjdk version "17.0.11" 2024-04-16 LTS

Operating System and version

Windows 11 Enterprise Version 10.0.22621

@armlesshobo armlesshobo added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant