【发布时间】:2021-05-23 17:08:41
【问题描述】:
我正在使用 蟒蛇:2.7.16 Elasticsearch:6.8.12 启用 TLS
我在我的服务器/主机上获得输出 如果我跑 curl --insecure $CREDS -X GET "localhost:9210/metricbeat*/_search" | python -m json.tool
如果我在我的 python 脚本中使用以下代码:
从弹性搜索导入弹性搜索,RequestsHttpConnection
url = Elasticsearch(['https://' + options.controller + ':9210/metricbeat*/_search'], verify_certs=False, connection_class=RequestsHttpConnection)
错误:
收集系统信息...
/Users/Library/Python/2.7/lib/python/site-packages/elasticsearch/connection/http_requests.py:141:UserWarning:使用带有 verify_certs=False 的 SSL 连接到 https://x.x.x.x:9210 是不安全的。
% self.host
等待查询结果...
错误:查询弹性搜索数据失败:未找到 u"
[option.controller 是我的服务器/主机]
任何帮助将不胜感激,谢谢。
【问题讨论】:
标签: python elasticsearch ssl ssl-certificate kibana