|
|
|
@ -10,17 +10,6 @@ from urllib3.exceptions import InsecureRequestWarning
|
|
|
|
|
|
|
|
|
|
warnings.simplefilter("once", InsecureRequestWarning)
|
|
|
|
|
warnings.simplefilter("once", DeprecationWarning)
|
|
|
|
|
# 生产环境推荐配置
|
|
|
|
|
# 1. 获取服务器CA证书
|
|
|
|
|
# 2. 使用以下配置替换当前配置
|
|
|
|
|
# context = ssl.create_default_context(cafile="path/to/ca.crt")
|
|
|
|
|
# es = Elasticsearch(
|
|
|
|
|
# hosts="https://10.10.14.206:9200",
|
|
|
|
|
# basic_auth=("elastic", "jv9h8uwRrRxmDi1dq6u8"),
|
|
|
|
|
# ssl_context=context
|
|
|
|
|
# )
|
|
|
|
|
|
|
|
|
|
# 开发环境临时方案(带警告抑制)
|
|
|
|
|
warnings.simplefilter("once", category=UserWarning)
|
|
|
|
|
|
|
|
|
|
context = ssl.create_default_context()
|
|
|
|
|