Sorry but this feels like we're troubleshooting your code now and I don't know how much of help I Can be with that. Please make sure that your code is functional so that we can focus on the SSL client authentication with Elasticsearch.
Above, I've asked you to this process for your keystore, you did that for your truststore
You removed .loadKeyMaterial from your code now so your client doesn't have the key and certificate it needs to authenticate to Elasticseach. You should call .loadKeyMaterial with the keystore that you would create following my instructions above.
This configuration is about setting the truststore with the appropriate trusted certificates on the client side so that the client can verify the certificate that Elasticsearch is presenting for TLS.
In your case, you needed to call loadKeyMaterial on your SSLContext so that the HttpClient can use the keystore in order to select the key and certificate to use for TLS client authentication. We will attempt to make this slightly clearer in our docs, thanks for your feedback!
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.