elasticsearch.exceptions.SSLError: ConnectionError([SSL: CERTIFICATE

elasticsearch.exceptions.SSLError: ConnectionError([SSL: CERTIFICATE,第1张

elasticsearch.exceptions.SSLError: ConnectionError([SSL: CERTIFICATE Python Elasticsearch报错
elasticsearch.exceptions.SSLError: ConnectionError([SSL: CERTIFICATE_VERIFY_FAILED] 
certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)) 
caused by: SSLError([SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: 
self signed certificate in certificate chain (_ssl.c:1076))
解决

加上context.verify_mode = ssl.CERT_NONE:

import ssl
from elasticsearch.connection import create_ssl_context

ssl_context = create_ssl_context( 
参考 

https://github.com/elastic/elasticsearch-py/issues/712
https://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification
https://github.com/certifi/python-certifi

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5718299.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-18

发表评论

登录后才能评论

评论列表(0条)

保存