Elasticsearch
从
python
具有
SSL
使用基本代码:
from elasticsearch import Elasticsearch
from ssl import create_default_context
context = create_default_context(cafile="path/to/cafile.pem")
es = Elasticsearch("https://elasticsearch.url:port", ssl_context=context, http_auth=('elastic','yourpassword'))
https://github.com/elastic/elasticsearch-py
我需要补给
cafile.pem
,和
http_auth
参数。在服务器上
python
正在运行的SSL连接已经设置好,所以我可以对
弹性搜索
. 它是用钥匙设置的
~/.ssh
id_rsa
id_rsa.pub
身份证_rsa.pub公司
钥匙代替
path/to/cafile.pem
~/.ssh文件
从安全角度看,这似乎不是一个好主意。那么,我不确定
.pub
与相同
.pem
,需要先转换吗?那么,也应该
http\U身份验证
ES
具有
)根据最佳实践-这就是问题所在。
更新
我两个都试过了
并由此产生
pem
https://serverfault.com/questions/706336/how-to-get-a-pem-file-from-ssh-key-pair
但两人都失败了
create_default_context
带着一个
unknown error
context.load_verify_locations(cafile, capath, cadata)
.