# Unable to get local issuer certificate (\_ssl.c:1007)))

**URL:** https://discuss.elastic.co/t/unable-to-get-local-issuer-certificate-ssl-c-1007/364462
**Category:** Elasticsearch
**Tags:** elastic-stack-security, docker
**Created:** [August 6, 2024, 10:03am UTC](https://discuss.elastic.co/t/unable-to-get-local-issuer-certificate-ssl-c-1007/364462 "2024-08-06T10:03:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SaraS](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SaraS](https://discuss.elastic.co/u/SaraS)
#### Post date: [August 6, 2024, 10:03am UTC](https://discuss.elastic.co/t/unable-to-get-local-issuer-certificate-ssl-c-1007/364462/1 "2024-08-06T10:03:50Z")

</div>

Hello.  
I run my elasticsearch via docker compose and i set ssl security for it and now i want to connect Elasticsearch from remote server  
when i `curl -X GET -u user:pass -k https://serverIP:9200/_cat/indices`  
i can see all my indices and also i have telnet connection but when i try to connect with python

```auto
client = Elasticsearch(
    ['https://user:pass@serverIP:9200'],
    api_key="E0-"  
)

```

I get the following error:

> TlsError: TLS error caused by: TlsError(TLS error caused by: SSLError([SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: unable to get local issuer certificate (\_ssl.c:1007)))

and when i tried to use container name instead of server ip i get

> ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(\<elastic\_transport.\_node.\_urllib3\_chain\_certs.HTTPSConnection object at 0x\>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution))

and how can i set cert path for it?  
Thanks

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [August 7, 2024, 5:16am UTC](https://discuss.elastic.co/t/unable-to-get-local-issuer-certificate-ssl-c-1007/364462/2 "2024-08-07T05:16:50Z")

</div>

The ["Connecting to a self-managed cluster"](https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/connecting.html#connect-self-managed-new) section of the python client docs has information on how to configure certificate trust.

---

<div class="post-metadata">

### Author: ![SaraS](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SaraS](https://discuss.elastic.co/u/SaraS)
#### Post date: [August 7, 2024, 6:46am UTC](https://discuss.elastic.co/t/unable-to-get-local-issuer-certificate-ssl-c-1007/364462/3 "2024-08-07T06:46:41Z")

</div>

Thanks
