File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
elasticsearch/stac_fastapi/elasticsearch
opensearch/stac_fastapi/opensearch Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 3
3
import ssl
4
4
from typing import Any , Dict , Set
5
5
6
+ import certifi
7
+
6
8
from elasticsearch import AsyncElasticsearch , Elasticsearch # type: ignore
7
9
from stac_fastapi .types .config import ApiSettings
8
10
@@ -31,9 +33,7 @@ def _es_config() -> Dict[str, Any]:
31
33
32
34
# Include CA Certificates if verifying certs
33
35
if config ["verify_certs" ]:
34
- config ["ca_certs" ] = os .getenv (
35
- "CURL_CA_BUNDLE" , "/etc/ssl/certs/ca-certificates.crt"
36
- )
36
+ config ["ca_certs" ] = os .getenv ("CURL_CA_BUNDLE" , certifi .where ())
37
37
38
38
# Handle authentication
39
39
if (u := os .getenv ("ES_USER" )) and (p := os .getenv ("ES_PASS" )):
Original file line number Diff line number Diff line change 3
3
import ssl
4
4
from typing import Any , Dict , Set
5
5
6
+ import certifi
6
7
from opensearchpy import AsyncOpenSearch , OpenSearch
7
8
8
9
from stac_fastapi .types .config import ApiSettings
@@ -32,9 +33,7 @@ def _es_config() -> Dict[str, Any]:
32
33
33
34
# Include CA Certificates if verifying certs
34
35
if config ["verify_certs" ]:
35
- config ["ca_certs" ] = os .getenv (
36
- "CURL_CA_BUNDLE" , "/etc/ssl/certs/ca-certificates.crt"
37
- )
36
+ config ["ca_certs" ] = os .getenv ("CURL_CA_BUNDLE" , certifi .where ())
38
37
39
38
# Handle authentication
40
39
if (u := os .getenv ("ES_USER" )) and (p := os .getenv ("ES_PASS" )):
You can’t perform that action at this time.
0 commit comments