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?
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).