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