# Connect with certificate to elasticsearch

**URL:** <https://discuss.elastic.co/t/connect-with-certificate-to-elasticsearch/257047>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [November 30, 2020, 10:14am UTC](https://discuss.elastic.co/t/connect-with-certificate-to-elasticsearch/257047 "2020-11-30T10:14:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk2](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@elk2](https://discuss.elastic.co/u/elk2)\
**Post date:** [November 30, 2020, 10:14am UTC](https://discuss.elastic.co/t/connect-with-certificate-to-elasticsearch/257047/1 "2020-11-30T10:14:02Z")

</div>

I'm trying to connect to elasticsearch on localhost machine with certificate and key but when I try to connect I have this error:

> curl --cacert /etc/elasticsearch/cert/node\_testuserCA.pem --cert /etc/elasticsearch/cert/node-pt-mast2.pem --key /etc/elasticsearch/cert/node-pt-mast2.key -GET [https://192.168.10.2:9200/](https://192.168.10.2:9200/) -kv
> 
> - About to connect() to 192.168.10.2 port 9200 (#0)
> - Trying 192.168.10.2...
> - Connected to 192.168.10.2 (192.168.10.2) port 9200 (#0)
> - Initializing NSS with certpath: sql:/etc/pki/nssdb
> - skipping SSL peer certificate verification
> - NSS: client certificate not found: T
> - NSS error -12271 (SSL\_ERROR\_BAD\_CERT\_ALERT)
> - SSL peer cannot verify your certificate.
> - Closing connection 0  
> curl: (58) NSS: client certificate not found: T  
> [testuser@node-pt-mast2 cert]#

---

<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:** [December 2, 2020, 4:11am UTC](https://discuss.elastic.co/t/connect-with-certificate-to-elasticsearch/257047/2 "2020-12-02T04:11:38Z")

</div>

> [@elk2](#):
>
> ```auto
> -GET 
> 
> ```

This should be `-XGET` or `--get`

---

<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:** [December 30, 2020, 4:11am UTC](https://discuss.elastic.co/t/connect-with-certificate-to-elasticsearch/257047/3 "2020-12-30T04:11:39Z")

</div>

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