记录这两天使用Python无法通过key连接Elasticsearch的情况。

问题记录

  参考官方配置如下:

python 无法通过key连接es解决办法

 

   但是不work。

解决

import ssl
from elasticsearch import Elasticsearch
ctx=ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
ctx.load_cert_chain("./filebeat.pem","./filebeat.key")
ctx.verify_mode=ssl.CERT_NONE
ctx.check_hostname=False
es = Elasticsearch(
    [{"host":"xx.xx.xx.xx","port":"9200"}],
    scheme="https",
    ssl_context=ctx,
)
print(es.info())

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
  • 2021-11-21
猜你喜欢
  • 2021-06-02
  • 2021-09-04
  • 2021-11-18
  • 2021-12-25
  • 2021-08-08
  • 2021-07-28
相关资源
相似解决方案