36 lines
1.5 KiB
Diff
36 lines
1.5 KiB
Diff
From 899221f26f8333254f27e85e99f8a42e75f1cecf Mon Sep 17 00:00:00 2001
|
|
From: Seth Michael Larson <seth.larson@elastic.co>
|
|
Date: Mon, 7 Jun 2021 13:20:26 -0500
|
|
Subject: [PATCH] Start testing on Python 3.10
|
|
|
|
---
|
|
elasticsearch/_async/http_aiohttp.py | 7 +++++--
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/elasticsearch/_async/http_aiohttp.py b/elasticsearch/_async/http_aiohttp.py
|
|
index 8c3a995..2057cdd 100644
|
|
--- a/elasticsearch/_async/http_aiohttp.py
|
|
+++ b/elasticsearch/_async/http_aiohttp.py
|
|
@@ -167,7 +167,10 @@ class AIOHttpConnection(AsyncConnection):
|
|
|
|
self.ssl_assert_fingerprint = ssl_assert_fingerprint
|
|
if self.use_ssl and ssl_context is None:
|
|
- ssl_context = ssl.SSLContext(ssl_version or ssl.PROTOCOL_TLS)
|
|
+ if ssl_version is None:
|
|
+ ssl_context = ssl.create_default_context()
|
|
+ else:
|
|
+ ssl_context = ssl.SSLContext(ssl_version)
|
|
|
|
# Convert all sentinel values to their actual default
|
|
# values if not using an SSLContext.
|
|
@@ -180,8 +183,8 @@ class AIOHttpConnection(AsyncConnection):
|
|
ssl_context.verify_mode = ssl.CERT_REQUIRED
|
|
ssl_context.check_hostname = True
|
|
else:
|
|
- ssl_context.verify_mode = ssl.CERT_NONE
|
|
ssl_context.check_hostname = False
|
|
+ ssl_context.verify_mode = ssl.CERT_NONE
|
|
|
|
ca_certs = CA_CERTS if ca_certs is None else ca_certs
|
|
if verify_certs:
|