# Using Python to Connect To Elastic Cloud

**URL:** <https://discuss.elastic.co/t/using-python-to-connect-to-elastic-cloud/199350>\
**Category:** Elastic Cloud Enterprise (ECE)\
**Created:** [September 13, 2019, 3:31am UTC](https://discuss.elastic.co/t/using-python-to-connect-to-elastic-cloud/199350 "2019-09-13T03:31:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelberg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelberg/32/51063_2.png) [@michaelberg](https://discuss.elastic.co/u/michaelberg)\
**Post date:** [September 13, 2019, 3:31am UTC](https://discuss.elastic.co/t/using-python-to-connect-to-elastic-cloud/199350/1 "2019-09-13T03:31:19Z")

</div>

Greetings Everyone!

I am building a project for University and want to do some experimenting with connecting to Elastic Cloud using Python ...

I already have Elastic Cloud and Kibana set up and it's working perfectly well and ingesting data from a couple of different servers I'm running ...

I am having a hard time finding documentation that outlines the steps you need to take in order to create whatever certificates you need to connect securely from Python code and then, I think, you need to upload those to the cloud platform and install them locally as well on the machine you'll be connecting "from" ...

Not looking for someone to "hand hold" but perhaps kick me in the right direction for where to find some good documentation on what needs to be done to make this connection!

I appreciate any and all advice/direction I can get! Thanks so much!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 13, 2019, 5:37am UTC](https://discuss.elastic.co/t/using-python-to-connect-to-elastic-cloud/199350/2 "2019-09-13T05:37:42Z")

</div>

The Elastic Cloud Elasticsearch service does not require any certificates to be set up. You can connect directly using HTTPS and basic auth.

---

<div class="post-metadata">

**Author:** ![michaelberg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelberg/32/51063_2.png) [@michaelberg](https://discuss.elastic.co/u/michaelberg)\
**Post date:** [September 13, 2019, 1:48pm UTC](https://discuss.elastic.co/t/using-python-to-connect-to-elastic-cloud/199350/3 "2019-09-13T13:48:58Z")

</div>

Thank you very kindly for your response ... that's exactly what I needed ... I was spinning my wheels and going off of, what I was think is, old documentation located here:

[https://www.elastic.co/guide/en/cloud-enterprise/1.0/ece-manage-certificates.html](https://www.elastic.co/guide/en/cloud-enterprise/1.0/ece-manage-certificates.html)

I was trying to follow it and it just wasn't making sense!

I tried connecting with the following format:

```auto
es = Elasticsearch(['https://user:secret@localhost:9243'])

```

When trying to connect this way I still got the error message as follows:

elasticsearch.exceptions.ImproperlyConfigured: Root certificates are missing for certificate validation. Either pass them in using the ca\_certs parameter or install certifi to use it automatically.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 13, 2019, 2:17pm UTC](https://discuss.elastic.co/t/using-python-to-connect-to-elastic-cloud/199350/4 "2019-09-13T14:17:17Z")

</div>

That is related to Elastic Cloud Enterprise which is a completely different product that allows you to manage multiple clusters.

---

<div class="post-metadata">

**Author:** ![michaelberg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelberg/32/51063_2.png) [@michaelberg](https://discuss.elastic.co/u/michaelberg)\
**Post date:** [September 13, 2019, 2:34pm UTC](https://discuss.elastic.co/t/using-python-to-connect-to-elastic-cloud/199350/5 "2019-09-13T14:34:20Z")

</div>

Oh my .... no wonder I was confused and turned around!

I am new to the Elastic stack but learning at a rapid pace ...

Now I know! 🙂 I appreciate you taking the time to answer my questions...

Cheers!

---

<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:** [September 27, 2019, 2:34pm UTC](https://discuss.elastic.co/t/using-python-to-connect-to-elastic-cloud/199350/6 "2019-09-27T14:34:20Z")

</div>

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