File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed
elasticsearch/stac_fastapi/elasticsearch
opensearch/stac_fastapi/opensearch Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ def _es_config() -> Dict[str, Any]:
51
51
if http_compress :
52
52
config ["http_compress" ] = True
53
53
54
+ # Handle authentication
55
+ if (u := os .getenv ("ES_USER" )) and (p := os .getenv ("ES_PASS" )):
56
+ config ["http_auth" ] = (u , p )
57
+
54
58
# Explicitly exclude SSL settings when not using SSL
55
59
if not use_ssl :
56
60
return config
@@ -63,10 +67,6 @@ def _es_config() -> Dict[str, Any]:
63
67
if config ["verify_certs" ]:
64
68
config ["ca_certs" ] = os .getenv ("CURL_CA_BUNDLE" , certifi .where ())
65
69
66
- # Handle authentication
67
- if (u := os .getenv ("ES_USER" )) and (p := os .getenv ("ES_PASS" )):
68
- config ["http_auth" ] = (u , p )
69
-
70
70
return config
71
71
72
72
Original file line number Diff line number Diff line change @@ -39,18 +39,6 @@ def _es_config() -> Dict[str, Any]:
39
39
if http_compress :
40
40
config ["http_compress" ] = True
41
41
42
- # Explicitly exclude SSL settings when not using SSL
43
- if not use_ssl :
44
- return config
45
-
46
- # Include SSL settings if using https
47
- config ["ssl_version" ] = ssl .PROTOCOL_SSLv23
48
- config ["verify_certs" ] = get_bool_env ("ES_VERIFY_CERTS" , default = True )
49
-
50
- # Include CA Certificates if verifying certs
51
- if config ["verify_certs" ]:
52
- config ["ca_certs" ] = os .getenv ("CURL_CA_BUNDLE" , certifi .where ())
53
-
54
42
# Handle authentication
55
43
if (u := os .getenv ("ES_USER" )) and (p := os .getenv ("ES_PASS" )):
56
44
config ["http_auth" ] = (u , p )
@@ -64,6 +52,18 @@ def _es_config() -> Dict[str, Any]:
64
52
65
53
config ["headers" ] = headers
66
54
55
+ # Explicitly exclude SSL settings when not using SSL
56
+ if not use_ssl :
57
+ return config
58
+
59
+ # Include SSL settings if using https
60
+ config ["ssl_version" ] = ssl .PROTOCOL_SSLv23
61
+ config ["verify_certs" ] = get_bool_env ("ES_VERIFY_CERTS" , default = True )
62
+
63
+ # Include CA Certificates if verifying certs
64
+ if config ["verify_certs" ]:
65
+ config ["ca_certs" ] = os .getenv ("CURL_CA_BUNDLE" , certifi .where ())
66
+
67
67
return config
68
68
69
69
You can’t perform that action at this time.
0 commit comments