# Elasticsearch Connection Error

**URL:** <https://discuss.elastic.co/t/elasticsearch-connection-error/348536>\
**Category:** Elasticsearch\
**Created:** [December 4, 2023, 9:32am UTC](https://discuss.elastic.co/t/elasticsearch-connection-error/348536 "2023-12-04T09:32:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Burak\_Karatay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/burak_karatay/32/123772_2.png) [@Burak\_Karatay](https://discuss.elastic.co/u/Burak_Karatay)\
**Post date:** [December 4, 2023, 9:32am UTC](https://discuss.elastic.co/t/elasticsearch-connection-error/348536/1 "2023-12-04T09:32:17Z")

</div>

I have physical server with elasticsearch installed and from another computer I try to connect the elasticsearch with this code:

```auto
const esClient = new Client({node: 'https://my-ip-address:5621', auth: {username: 'elastic', password: 'mypassword'}, 
caFingerprint: "91:9F:49:82:A0:5D:5A:2E:FA:3D..."
tls: {rejectUnauthorized: false}})

```

I got this error: **Error pinging server: ConnectionError: Invalid or malformed certificate**

I generated this fingerprint from the server, in the server there is a container for elasticsearch and from /config/certs/ca.crt and /config/certs/elasticsearch.crt. Both fingerprints didn't work. Can anyone help me please?  
 ![Screenshot 2023-12-04 at 12.31.12](https://us1.discourse-cdn.com/elastic/original/3X/9/2/92981c62166d088eaeee24e6cecf18327f3018c0.png)

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [December 4, 2023, 3:08pm UTC](https://discuss.elastic.co/t/elasticsearch-connection-error/348536/2 "2023-12-04T15:08:08Z")

</div>

Hi @Burak_Karatay,

Thanks for sharing. It looks like an invalid certificate issue.

How are you getting a hold of the fingerprint? Are you following the command steps from [here](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html#auth-ca-fingerprint) in the documentation?

---

<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:** [January 1, 2024, 3:08pm UTC](https://discuss.elastic.co/t/elasticsearch-connection-error/348536/3 "2024-01-01T15:08:25Z")

</div>

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