fix: Fix es self signed certificate

This commit is contained in:
junjun
2026-04-20 13:33:40 +08:00
parent 0e0b8736fe
commit ed919c9c49
+2 -2
View File
@@ -113,13 +113,13 @@ def get_es_data_by_http(conf: DatasourceConf, sql: str):
# Security improvement: Enable SSL certificate verification
# Note: In production, always set verify=True or provide path to CA bundle
# If using self-signed certificates, provide the cert path: verify='/path/to/cert.pem'
verify_ssl = True if not url.startswith('https://localhost') else False
# verify_ssl = True if not url.startswith('https://localhost') else False
response = requests.post(
host,
data=json.dumps({"query": sql}),
headers=get_es_auth(conf),
verify=verify_ssl,
verify=False,
timeout=30 # Add timeout to prevent hanging
)