From 9c9692b2334d786f9beb10a8684d69d4389c9911 Mon Sep 17 00:00:00 2001 From: merlinz01 <158784988+merlinz01@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:55:31 -0500 Subject: [PATCH] Implement AsyncOpenSearch() parameter `ssl_assert_hostname` to allow disabling SSL hostname verification Signed-off-by: merlinz01 <158784988+merlinz01@users.noreply.github.com> --- CHANGELOG.md | 1 + opensearchpy/_async/http_aiohttp.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fccce1a..a31ac2ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] ### Added - Added `AsyncSearch#collapse` ([827](https://github.com/opensearch-project/opensearch-py/pull/827)) +- Implement `ssl_assert_hostname` boolean parameter for `AsyncOpenSearch.__init__()` ([#dummy](https://github.com/opensearch-project/opensearch-py/pull/dummy)) ### Changed ### Deprecated ### Removed diff --git a/opensearchpy/_async/http_aiohttp.py b/opensearchpy/_async/http_aiohttp.py index 1e3da465..5828fda7 100644 --- a/opensearchpy/_async/http_aiohttp.py +++ b/opensearchpy/_async/http_aiohttp.py @@ -85,6 +85,7 @@ def __init__( client_cert: Any = None, client_key: Any = None, ssl_version: Any = None, + ssl_assert_hostname: bool = True, ssl_assert_fingerprint: Any = None, maxsize: Optional[int] = 10, headers: Any = None, @@ -177,7 +178,7 @@ def __init__( if verify_certs: ssl_context.verify_mode = ssl.CERT_REQUIRED - ssl_context.check_hostname = True + ssl_context.check_hostname = ssl_assert_hostname else: ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE