Pavel Petrashov
Pavel Petrashov

Reputation: 1262

Spring boot + elasticsearch wrong default port

I already asked this question about spring boot and elasticsearch.

I have this config:

@Bean
@Override
public RestHighLevelClient elasticsearchClient() {
    ClientConfiguration clientConfiguration
            = ClientConfiguration.builder()
            .connectedTo("foo.es.amazonaws.com")
            .usingSsl()
            .build();

    return RestClients.create(clientConfiguration).rest();
}

But I get this config(port: 9200 instead of 443)

enter image description here

I added usingSsl() and expected 443 port. How does it work?

Upvotes: 0

Views: 492

Answers (1)

Abacus
Abacus

Reputation: 19421

.connectedTo("foo.es.amazonaws.com:443")

useSsl() activates SSL on the defined connection. This must not be necessarily 443.

Upvotes: 1

Related Questions