Skip to content

Commit 434b4d0

Browse files
Use SSL and verify certs only for HTTPS (port 443) (#1603)
Co-authored-by: Lucas Hanson <lucascchanson@gmail.com>
1 parent 9b89aaf commit 434b4d0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

awswrangler/opensearch/_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ def _strip_endpoint(endpoint: str) -> str:
3333
return uri_schema.sub("", endpoint).strip().strip("/")
3434

3535

36+
def _is_https(port: int) -> bool:
37+
return port == 443
38+
39+
3640
def connect(
3741
host: str,
3842
port: Optional[int] = 443,
@@ -95,8 +99,8 @@ def connect(
9599
host=_strip_endpoint(host),
96100
port=port,
97101
http_auth=http_auth,
98-
use_ssl=True,
99-
verify_certs=True,
102+
use_ssl=_is_https(port),
103+
verify_certs=_is_https(port),
100104
connection_class=RequestsHttpConnection,
101105
timeout=30,
102106
max_retries=10,

0 commit comments

Comments
 (0)