Authentication Error After Configuring SSL

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

Any suggestions here?

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

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