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?
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.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.