# Authentication Error After Configuring SSL

**URL:** <https://discuss.elastic.co/t/authentication-error-after-configuring-ssl/226979>\
**Category:** Elasticsearch\
**Created:** [April 7, 2020, 6:23pm UTC](https://discuss.elastic.co/t/authentication-error-after-configuring-ssl/226979 "2020-04-07T18:23:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emre\_Altan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emre_altan/32/65855_2.png) [@Emre\_Altan](https://discuss.elastic.co/u/Emre_Altan)\
**Post date:** [April 7, 2020, 6:23pm UTC](https://discuss.elastic.co/t/authentication-error-after-configuring-ssl/226979/1 "2020-04-07T18:23:36Z")

</div>

Hi,  
I'm trying to configure ssl and basic authentication in an Amazon EC2 instance. I've installed the elasticsearch, opened authentication by setting `xpack.security.enabled` to `true`, and set a password to built-in users with `bin/elasticsearch-setup-passwords interactive`. It was working nicely, I could access to elasticsearch with my password without any problem. But when I configured the ssl to elastic, it started to not accepting the same password!

I can still access to the elastic if i disable the authentication with ssl. But i also need the authentication.

Moreover, I can authenticate with this curl with http protocol:  
`curl -u elastic 'http://elastic.mydomain.xyz:9200/_xpack/security/_authenticate?pretty'`

But when I use https, it's giving authentication error:  
`curl -u elastic 'https://elastic.mydomain.xyz:9200/_xpack/security/_authenticate?pretty'`

Result:  
`{ "type" : "security_exception", "reason" : "failed to authenticate user [elastic]", "header" : { "WWW-Authenticate" : ["Bearer realm=\"security\"", "ApiKey", "Basic realm=\"security\" charset=\"UTF-8\""] } }`

What's going on? Do you have any ideas? How can i fix it?

**-Edit-**  
My yml settings below:

- `network.host: 0.0.0.0`

- `discovery.seed_hosts: []`

- `discovery.type: single-node`

- `xpack.security.enabled: true`

- `xpack.security.http.ssl.enabled: true`

- `xpack.security.http.ssl.key: /etc/elasticsearch/ssl/elastic.mydomain.xyz/privkey1.pem`

- `xpack.security.http.ssl.certificate: /etc/elasticsearch/ssl/elastic.mydomain.xyz/fullchain1.pem`

---

<div class="post-metadata">

**Author:** ![Emre\_Altan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emre_altan/32/65855_2.png) [@Emre\_Altan](https://discuss.elastic.co/u/Emre_Altan)\
**Post date:** [April 9, 2020, 9:08am UTC](https://discuss.elastic.co/t/authentication-error-after-configuring-ssl/226979/2 "2020-04-09T09:08:48Z")

</div>

Any suggestions here?

---

<div class="post-metadata">

**Author:** ![Emre\_Altan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emre_altan/32/65855_2.png) [@Emre\_Altan](https://discuss.elastic.co/u/Emre_Altan)\
**Post date:** [April 9, 2020, 3:28pm UTC](https://discuss.elastic.co/t/authentication-error-after-configuring-ssl/226979/3 "2020-04-09T15:28:06Z")

</div>

Found the problem. Just added `xpack.security.http.ssl.verification_mode: certificate` to the elasticsearch.yml and voila! It's working now.

---

<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:** [May 7, 2020, 3:28pm UTC](https://discuss.elastic.co/t/authentication-error-after-configuring-ssl/226979/4 "2020-05-07T15:28:07Z")

</div>

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