Skip to content

Commit 47f1d18

Browse files
authored
fix: option verify-ssl impacts on server certs only (#46)
1 parent ff44be6 commit 47f1d18

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

kubernetes_asyncio/client/rest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ def __init__(self, configuration, pools_size=4, maxsize=4):
6464
configuration.cert_file, keyfile=configuration.key_file
6565
)
6666

67+
if not configuration.verify_ssl:
68+
ssl_context.check_hostname = False
69+
ssl_context.verify_mode = ssl.CERT_NONE
70+
6771
connector = aiohttp.TCPConnector(
6872
limit=maxsize,
69-
ssl_context=ssl_context if configuration.verify_ssl else None,
70-
verify_ssl=configuration.verify_ssl
73+
ssl_context=ssl_context
7174
)
7275

7376
# https pool manager

0 commit comments

Comments
 (0)