# How do I fix TLS Error when connecting with Python Client?

**URL:** <https://discuss.elastic.co/t/how-do-i-fix-tls-error-when-connecting-with-python-client/307907>\
**Category:** Elasticsearch\
**Created:** [June 22, 2022, 5:49pm UTC](https://discuss.elastic.co/t/how-do-i-fix-tls-error-when-connecting-with-python-client/307907 "2022-06-22T17:49:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DataStorageMuse](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@DataStorageMuse](https://discuss.elastic.co/u/DataStorageMuse)\
**Post date:** [June 22, 2022, 5:49pm UTC](https://discuss.elastic.co/t/how-do-i-fix-tls-error-when-connecting-with-python-client/307907/1 "2022-06-22T17:49:58Z")

</div>

When I try to connect to Elasticsearch with Python Client, I get this error: `elastic_transport.TlsError: TLS error caused by: TlsError(TLS error caused by: SSLError([SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)))`. I can successfully open localhost:9200 in the browser, and the curl requests are working. How do I fix this?

---

<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:** [July 20, 2022, 5:50pm UTC](https://discuss.elastic.co/t/how-do-i-fix-tls-error-when-connecting-with-python-client/307907/2 "2022-07-20T17:50:42Z")

</div>

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