I created a new 2 node cluster ES 7.2.0. I have created successful integrations with the Java REST API in the past, but now I am adding the security layer and I am somewhat at a loss.
However, there are a few parts missing for me, being a novice in the SSL implementation.
Is there a more complete guide/sample on how to connect the JAVA REST client to a ES cluster that used the procedure described in the blog?
Forgive me for being a newbie in this, but for example I have no idea where the keystore should be coming from in the code shown on the page to initialize the encrypted communication.
Do I even need a keystore on my client or do I just need to open an SSL style connection and pass on the username and password for the connection?
So, I think I found most of the information.
Here is what I did:
Created a jks keystore by importing the elastic ca.crt file into a new store
imported the node certificates in the store
Updated my java code to set the necessary config:
private RestHighLevelClient SSLConnection(HttpHost hosts) {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(connectionUser, connectionPassword));
I know the catch side can be more efficient but that is just for clarity sake during dev.
It seems to work, but I wanted to check whether I missed something that might bite me later like with regards, to performance
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.