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

Config retriever doesn't get config for spring-cloud-config with HTTPS #149

Open
minhaj86 opened this issue Aug 24, 2022 · 4 comments
Open
Labels

Comments

@minhaj86
Copy link

minhaj86 commented Aug 24, 2022

Questions

Vertx config retriever does not work with spring-cloud-config server with HTTPS even if the spring-cloud-config server is configured with proper certificate (not self signed) . Underlying exception says "Connection closed"

Sample code:

    ConfigStoreOptions springCloudStore =
            new ConfigStoreOptions()
                    .setType("spring-config-server")
                    .setConfig(
                            new JsonObject()
                                    .put("url", String.format("https://some-cloud-config-server.com/application/profile", profile))
                                    .put("ssl", true)
                                    .put("timeout", 60000)
                                    .put("user", "dummy-user")
                                    .put("password", "secret")
                    );

    ConfigRetriever retriever =
            ConfigRetriever.create(
                    vertx,
                    new ConfigRetrieverOptions()
                            .addStore(springCloudStore)
            );
    retriever.getConfig(json -> {
        if (json.failed()) {
            log.error("failed to retrieve config {}", json.cause().getMessage());
            return;
        }

Version

4.3.3

@minhaj86 minhaj86 added the bug label Aug 24, 2022
@gaol
Copy link
Member

gaol commented Aug 26, 2022

According to https://vertx.io/docs/vertx-config/java/#_spring_config_server_store, you need to configure SSL/TLS set up in httpClientConfiguration of your configuration.

And I don't see any trustOptions set up in your code? do you have the peer certificate installed in your JDK?

@minhaj86
Copy link
Author

Tried with httpClientConfiguration, something like this:

.setConfig(new JsonObject()
.put("url", url)
.put("timeout", 60000L)
.put("httpClientConfiguration", new JsonObject()
.put("trustAll", true)
.put("ssl", true)));

But still doesn't work.

@minhaj86
Copy link
Author

Any update on this?

@gaol
Copy link
Member

gaol commented Oct 20, 2022

A reproducer would be helpful to identity the issue. the exception stack trace etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants