Spring Data ElasticSearch with SSL


I'm trying to understand how basic SSL works using Spring Data Elasticsearch.
In order to use SSL for Secure HTTPS configuration you need to call usingSsl() method without any parameter during creation of RestHighLevelClient client:
ClientConfiguration.MaybeSecureClientConfigurationBuilder builder = ClientConfiguration.builder().usingSsl()

For common code example please refer to:

My question is how the client knows which trust store it should use for server certificate. Is it a property that should be provided in some configuration file? If yes, what is a name of the property and where it should be defined?

Thank you in advance

This is more of a question for the spring data team than elasticsearch. That said, the Builder class has a overloaded usingSsl method that takes a SSLContext parameter.

Thank you. Yes, indeed, there is an overloaded method, but I would like to know how Elasticsearch server trust store is defined without parameters.

The spring data code configures the client, not the server. Assuming your question is about how "client" truststore is configured without parameter. A reasonable guess would be it will use the JDK's default truststore (cacerts).

Yes, it seems so. Spring Data should use default Elasticsearch certificate generated by publicly trusted CA installed on client's machine. Thank you very much.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.