Missing Authentication for REST request

Hi again.

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.

Hi i removed them bits to be inline with the documentation at https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/_encrypted_communication.html

Thank you for you help taking a few steps back and redoing the truststore and keystore from scratch alongside your last few comments got it working

1 Like

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!

Glad you got it working in the end :slight_smile:

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