Open cmanzur opened 2 years ago
The line...
context = create_default_context(module.params['cafile'])
is incorrect. Function documenttion at https://docs.python.org/3/library/ssl.html#ssl.create_default_context
Exactly, are you planning to change this?
Right at the moment no, I've got little time atm, but feel free to submit and PR & tests.
Note that "verify_certs" isn't an option in this case because of another bug in the handling of the "connection_options".
SUMMARY
I'm using a self signed Certificate. If I don't specify
cafile
the error is:ConnectionError([SSL: CERTIFICATE_VERIFY_FAILED] self signed certificate in certificate chain ...)
If I use
cafile
the error is:fatal: msg: Elastic error: /usr/local/share/ca-certificate/ca.crt
(which is the PATH of the CA on my host)The CA is already loaded in the host
update-ca-certificates
How can I verify the CA? Or set
verify_certs = False
as a workaround?ISSUE TYPE
COMPONENT NAME
elastic_common.py
ANSIBLE VERSION
COLLECTION VERSION
OS / ENVIRONMENT
Ubuntu 20.04
STEPS TO REPRODUCE
EXPECTED RESULTS
Should connect to ES. If I use
curl
with same parameters it works, so it's a problem in the library.ACTUAL RESULTS