question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"elasticsearch.exceptions.ImproperlyConfigured: Root certificates are missing..." even with certifi installed

See original GitHub issue

Creating an Elasticsearch client with use_ssl=True and verify_certs=True fails with elasticsearch.exceptions.ImproperlyConfigured: Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or install certifi to use it automatically.

running this in python 2.7 with certifi installed:

$ python --version                                                                                                                                                                                              11:39:54
Python 2.7.12+
$ pip list                                                                                                                                                                                                      11:38:52
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
backports.shutil-get-terminal-size (1.0.0)
bcrypt (3.1.3)
boto3 (1.4.7)
botocore (1.7.43)
certifi (2017.11.5)
cffi (1.10.0)
chardet (3.0.4)
decorator (4.1.2)
Django (1.11.6)
django-crispy-forms (1.6.1)
docutils (0.14)
elasticsearch (6.0.0)
enum34 (1.1.6)
falcon (1.2.0)
futures (3.1.1)
idna (2.6)
ipython (5.5.0)
ipython-genutils (0.2.0)
jmespath (0.9.3)
lxml (3.8.0)
numpy (1.13.3)
olefile (0.44)
pandas (0.21.0)
pathlib2 (2.3.0)
pexpect (4.3.0)
pickleshare (0.7.4)
Pillow (4.2.1)
pip (9.0.1)
pkg-resources (0.0.0)
prompt-toolkit (1.0.15)
ptyprocess (0.5.2)
pycparser (2.18)
Pygments (2.2.0)
python-dateutil (2.6.1)
python-mimeparse (1.6.0)
pytz (2017.3)
requests (2.18.4)
requests-aws4auth (0.9)
requests-futures (0.9.7)
s3transfer (0.1.11)
scandir (1.6)
setuptools (36.0.1)
simplegeneric (0.8.1)
six (1.11.0)
SkySerpent (0.1.55)
traitlets (4.3.2)
trollius (2.1)
urllib3 (1.22)
wcwidth (0.1.7)
webkit2png (0.8.2)
wheel (0.30.0a0)

This appears to only affect version 6.0.0. I was able to successfully create the client in the same environment after backporting to 5.5.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

23reactions
honzakralcommented, Nov 14, 2017

Thanks, this is a bug cause by https://github.com/elastic/elasticsearch-py/pull/635#discussion_r134012922

The workaround is to pass in the ca_certs explicitly: Elasticsearch(use_ssl=True, ca_certs=certifi.where())

sorry about that!

18reactions
DeeeFOXcommented, Feb 27, 2018

es = Elasticsearch(“https://host:port”, http_auth=(user,pass), verify_certs=False) worked

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble connecting to ElasticSearch Cloud via python library
Can't connect, it's telling me "elasticsearch.exceptions.ImproperlyConfigured: Root certificates are missing for certificate validation.
Read more >
Unable to access ElasticSearch AWS through Python
elasticsearch -py doesn't ship with default set of root certificates. To have working SSL certificate validation you need to either specify ...
Read more >
Elasticsearch Documentation
The library is compatible with all Elasticsearch versions since 0.90.x but you have to use a matching major version:.
Read more >
Root certificates are missing for certificate validation. Either ...
[Solved]-Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or install certifi to use it automatically- ...
Read more >
Unable to access ElasticSearch AWS through Python – iTecNote
ImproperlyConfigured ('Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or install certifi to use ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found