# Connecting via Elasticsearch-py with X-pack enabled

**URL:** <https://discuss.elastic.co/t/connecting-via-elasticsearch-py-with-x-pack-enabled/127043>\
**Category:** Elasticsearch\
**Created:** [April 6, 2018, 7:38am UTC](https://discuss.elastic.co/t/connecting-via-elasticsearch-py-with-x-pack-enabled/127043 "2018-04-06T07:38:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emil.mirzayev](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@emil.mirzayev](https://discuss.elastic.co/u/emil.mirzayev)\
**Post date:** [April 6, 2018, 7:38am UTC](https://discuss.elastic.co/t/connecting-via-elasticsearch-py-with-x-pack-enabled/127043/1 "2018-04-06T07:38:08Z")

</div>

Hi there. I have two instances of Elastic. One is cloud ELK and the other is on my local machine. I use the one on my local machine as sandbox. My question is, how I can connect to it when having X-pack security enabled? On cloud, it is easy and the model is: `https://elastic:PASSWORD@URL to Kibana Instance.`  
What is it with local machine? I had as default connection arguments `{'host': 'localhost', 'port': 9200}`, however, after installing X-pack I can not connect to it which is expected.  
How I can do it now with my username and password?

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [April 13, 2018, 9:38am UTC](https://discuss.elastic.co/t/connecting-via-elasticsearch-py-with-x-pack-enabled/127043/2 "2018-04-13T09:38:45Z")

</div>

Hi, please see the section [SSL and authentication](http://elasticsearch-py.readthedocs.io/en/master/index.html#ssl-and-authentication) in the Python client docs.

---

<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:** [May 11, 2018, 9:38am UTC](https://discuss.elastic.co/t/connecting-via-elasticsearch-py-with-x-pack-enabled/127043/3 "2018-05-11T09:38:52Z")

</div>

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