8000 Change how ssl_wrap_socket handles certfiles and keyfiles to match th… · python-telegram-bot/urllib3@afd554d · GitHub 8000
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 21, 2023. It is now read-only.

Commit afd554d

Browse files
author
Tye Wang
committed
Change how ssl_wrap_socket handles certfiles and keyfiles to match the regular python ssl library
1 parent f9bee9b commit afd554d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

urllib3/contrib/pyopenssl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
261261
ssl_version=None):
262262
ctx = OpenSSL.SSL.Context(_openssl_versions[ssl_version])
263263
if certfile:
264+
keyfile = keyfile or certfile # Match behaviour of the normal python ssl library
264265
ctx.use_certificate_file(certfile)
265266
if keyfile:
266267
ctx.use_privatekey_file(keyfile)

0 commit comments

Comments
 (0)
0