Skip to content

Commit be114d9

Browse files
authored
Merge pull request #222 from stac-utils/ca_certs
Default to use cerifi.where() to find the ca_certs
2 parents e479a23 + dec8305 commit be114d9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1818

1919
- Updated the pip_docker example to use stac-fastapi.elasticsearch 2.1.0 and the elasticsearch 8.11.0 docker image. [#216](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/216)
2020
- Updated the Data Loader CLI tool to accept a base_url, a data directory, a custom collection id, and an option to use bulk insert. [#218](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/218)
21+
- Changed the default `ca_certs` value to use `certifi.where()` to find the installed certificate authority. [#222](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/222)
2122

2223
### Fixed
2324

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import ssl
44
from typing import Any, Dict, Set
55

6+
import certifi
7+
68
from elasticsearch import AsyncElasticsearch, Elasticsearch # type: ignore
79
from stac_fastapi.types.config import ApiSettings
810

@@ -31,9 +33,7 @@ def _es_config() -> Dict[str, Any]:
3133

3234
# Include CA Certificates if verifying certs
3335
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())
3737

3838
# Handle authentication
3939
if (u := os.getenv("ES_USER")) and (p := os.getenv("ES_PASS")):

stac_fastapi/opensearch/stac_fastapi/opensearch/config.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import ssl
44
from typing import Any, Dict, Set
55

6+
import certifi
67
from opensearchpy import AsyncOpenSearch, OpenSearch
78

89
from stac_fastapi.types.config import ApiSettings
@@ -32,9 +33,7 @@ def _es_config() -> Dict[str, Any]:
3233

3334
# Include CA Certificates if verifying certs
3435
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())
3837

3938
# Handle authentication
4039
if (u := os.getenv("ES_USER")) and (p := os.getenv("ES_PASS")):

0 commit comments

Comments
 (0)