# Add elasticsearch security by x-pack authentificaiton

**URL:** <https://discuss.elastic.co/t/add-elasticsearch-security-by-x-pack-authentificaiton/171795>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [March 11, 2019, 3:43pm UTC](https://discuss.elastic.co/t/add-elasticsearch-security-by-x-pack-authentificaiton/171795 "2019-03-11T15:43:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hichMEN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hichmen/32/40216_2.png) [@hichMEN](https://discuss.elastic.co/u/hichMEN)\
**Post date:** [March 11, 2019, 3:43pm UTC](https://discuss.elastic.co/t/add-elasticsearch-security-by-x-pack-authentificaiton/171795/1 "2019-03-11T15:43:32Z")

</div>

I'm using elasticsearch5.5.2 with java spring boot application.

I would firstly, add the default authentification, after, connect it to the ldap.

So, I added:  
.put("xpack.security.user", "transport\_client\_user:changeme")  
.put("client.transport.ignore\_cluster\_name", true)  
.put("xpack.security.transport.ssl.enabled", "true")  
.put("xpack.ssl.keystore.path", xxxx.pfx)  
.put("xpack.ssl.keystore.password", xxxx)  
.put("xpack.ssl.truststore.path", xxxx)  
.put("xpack.ssl.truststore.password", xxxx.pfx)  
.put("client.transport.sniff", true)  
.put("transport.tcp.port", 9300)  
.build();

I got the following error: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{wcxlZUAyTLW\_uAoYXOMAYw}{localhost}{127.0.0.1:9200}]

I suppose that it's relative to the default user/password? (when I turn ssl.enable to false, it works).

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [March 12, 2019, 6:53am UTC](https://discuss.elastic.co/t/add-elasticsearch-security-by-x-pack-authentificaiton/171795/2 "2019-03-12T06:53:43Z")

</div>

Hi there,

Please go through [our documentation](https://www.elastic.co/guide/en/x-pack/5.5/java-clients.html) on how to setup Transport client to work with security. I believe all your questions are answered there, but if something is still unclear, we'd be happy to help.

Also, keep in mind that the transport client is deprecated in version 7.0.0 in favor of the [high level rest client](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.6/java-rest-high.html) so if you're planning on upgrading soon, you might want to look into migrating to the that instead of committing effort into building a solution with the transport client

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 9, 2019, 6:53am UTC](https://discuss.elastic.co/t/add-elasticsearch-security-by-x-pack-authentificaiton/171795/3 "2019-04-09T06:53:44Z")

</div>

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