I'm able to hit the endpoint https://xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: essvc-regiment-neptune-es-dev.ancestrydata.int-06062023.p12/_cat/nodes with out any issues.
When I try communicating from my python code.
from elasticsearch import Elasticsearch
from ssl import create_default_context
from elasticsearch import RequestsHttpConnection
I get this error:
Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))) caused by: SSLError(HTTPSConnectionPool(host='essvc-regiment-neptune-es-dev.ancestrydata.int', port=9200): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)'))))
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)
I'm able to hit the endpoint https://xpack.security.http.ssl.enabled: true xpack.security.http.ssl.keystore.path: essvc-regiment-neptune-es-dev.ancestrydata.int-06062023.p12/_cat/nodes with out any issues.
When I try communicating from my python code.
from elasticsearch import Elasticsearch
from ssl import create_default_context
from elasticsearch import RequestsHttpConnection
ssl_context = create_default_context()
# Set the path to the CA certificate file
ssl_context.load_verify_locations(cafile="/Users/creynolds/Downloads/essvc-regiment-neptune-es-dev.ancestrydata.int-06062023.pem")
# Create an Elasticsearch instance with HTTPS connection
context = create_default_context(cafile="/Users/creynolds/Downloads/essvc-regiment-neptune-es-dev.ancestrydata.int-06062023.pem")
# es = Elasticsearch(['[https://essvc-regiment-neptune-es-dev.ancestrydata.int:9200 ](https://essvc-regiment-neptune-es-dev.ancestrydata.int:9200)'], http_auth=("elastic", "AveZDd5gYqWC0qUa09Hl"), ssl_context=ssl_context ) #,use_ssl=True, verify_certs=True, ca_certs="/Users/creynolds/Downloads/essvc-regiment-neptune-es-dev.ancestrydata.int-06062023.p12",) #,ssl_context=ssl_context)
es = Elasticsearch(['[https://essvc-regiment-neptune-es-dev.ancestrydata.int:9200 ](https://essvc-regiment-neptune-es-dev.ancestrydata.int:9200)'], connection_class=RequestsHttpConnection, use_ssl=True, http_auth=("elastic", "AveZDd5gYqWC0qUa09Hl"), verify_certs=True, ssl_context=ssl_context) #, use_ssl=True, ssl_context=ssl_context) #verify_certs=False)
print(es.info())
I get this error:
Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))) caused by: SSLError(HTTPSConnectionPool(host='essvc-regiment-neptune-es-dev.ancestrydata.int', port=9200): Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)'))))
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)
```
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.