# SSLError: ConnectionErro SSL: WRONG\_VERSION\_NUMBER

**URL:** <https://discuss.elastic.co/t/sslerror-connectionerro-ssl-wrong-version-number/262566>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [January 28, 2021, 9:20pm UTC](https://discuss.elastic.co/t/sslerror-connectionerro-ssl-wrong-version-number/262566 "2021-01-28T21:20:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pemfir](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@pemfir](https://discuss.elastic.co/u/pemfir)\
**Post date:** [January 28, 2021, 9:20pm UTC](https://discuss.elastic.co/t/sslerror-connectionerro-ssl-wrong-version-number/262566/1 "2021-01-28T21:20:54Z")

</div>

After enabling Xpack and setting SSL/TSL for a single node and username and password, i am trying to index a single data point

```
from elasticsearch import Elasticsearch
from datetime import datetime
es = Elasticsearch(
    ['server'],
    http_auth=('user', 'password'),
    scheme="https",
    port=9200,
)

doc = {
    'author': 'kimchy',
    'text': 'Elasticsearch: cool. bonsai cool.',
    'timestamp': datetime.now(),
}
res = es.index(index="test-index", id=1, body=doc)

```

and i get

> SSLError: ConnectionError([SSL: WRONG\_VERSION\_NUMBER] wrong version number (\_ssl.c:1076)) caused by: SSLError([SSL: WRONG\_VERSION\_NUMBER] wrong version number (\_ssl.c:1076))

my SSL version in python and server match. The terminal commands below return the same values

```auto
python -c "import ssl; print(ssl.OPENSSL_VERSION)"
openssl version

```

i tried a variety of settings based on online research such as

```auto
from elasticsearch import RequestsHttpConnection
es = Elasticsearch("https://user:password@server:9200")
es = Elasticsearch("https://user:password@server:9200", ca_certs=False, verify_certs=False)
es = Elasticsearch(["server"], port=9200, connection_class=RequestsHttpConnection, http_auth=('user', 'password'), use_ssl=True, verify_certs=False)

```

---

<div class="post-metadata">

**Author:** ![Andrew\_G](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_g/32/49178_2.png) [@Andrew\_G](https://discuss.elastic.co/u/Andrew_G)\
**Post date:** [January 28, 2021, 9:59pm UTC](https://discuss.elastic.co/t/sslerror-connectionerro-ssl-wrong-version-number/262566/2 "2021-01-28T21:59:15Z")

</div>

Hi @pemfir would you be willing to post this connection error to the `Elastic Stack > Elasticsearch` category, where other users have asked about [similar connection errors](https://discuss.elastic.co/t/python-ssl-error/189407/14), linked below?

> **[Elasticsearch](https://discuss.elastic.co/c/elastic-stack/elasticsearch/6)**
>
> Elasticsearch is a distributed, RESTful search and analytics engine capable of addressing a growing number of use cases. As the heart of the Elastic Stack, it centrally stores your data for lightning fast search, fine‑tuned relevancy, and powerful analytics that scale with ease.

The _Elastic Security_ category is specific to to the [Elastic Security Solution](https://www.elastic.co/security).

---

<div class="post-metadata">

**Author:** ![pemfir](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@pemfir](https://discuss.elastic.co/u/pemfir)\
**Post date:** [January 28, 2021, 10:01pm UTC](https://discuss.elastic.co/t/sslerror-connectionerro-ssl-wrong-version-number/262566/3 "2021-01-28T22:01:40Z")

</div>

Thank you ! Changed the category. i do not see any question/answer for the issue i have raised here, and now with your response, i may not get much attention as readers may assume this question has already been answered. I have spent a lot of time on fixing this, and would appreciate some hints.

---

<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:** [January 29, 2021, 5:49am UTC](https://discuss.elastic.co/t/sslerror-connectionerro-ssl-wrong-version-number/262566/4 "2021-01-29T05:49:15Z")

</div>

Can you provide your elasticsearch node configuration (`elasticsearch.yml`) ?

Have you successfully connected to your node via curl or Kibana? If so, can you provide an example of the curl command & output?

---

<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:** [February 26, 2021, 5:49am UTC](https://discuss.elastic.co/t/sslerror-connectionerro-ssl-wrong-version-number/262566/5 "2021-02-26T05:49:20Z")

</div>

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