Skip to content

Commit 4aba1b6

Browse files
SNOW-721780: Update pyopenssl requirement from <23.0.0,>=16.2.0 to >=16.2.0,<24.0.0 (#1386)
* Update pyopenssl requirement from <23.0.0,>=16.2.0 to >=16.2.0,<24.0.0 Updates the requirements on [pyopenssl](https://github.com/pyca/pyopenssl) to permit the latest version. - [Release notes](https://github.com/pyca/pyopenssl/releases) - [Changelog](https://github.com/pyca/pyopenssl/blob/main/CHANGELOG.rst) - [Commits](pyca/pyopenssl@16.2.0...23.0.0) --- updated-dependencies: - dependency-name: pyopenssl dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * pulling in 55216b730c48f07b2590d814684b981b3ad50f5c from upstream Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mark Keller <[email protected]>
1 parent 91ec838 commit 4aba1b6

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ install_requires =
4646
cffi>=1.9,<2.0.0
4747
cryptography>=3.1.0,<41.0.0
4848
oscrypto<2.0.0
49-
pyOpenSSL>=16.2.0,<23.0.0
49+
pyOpenSSL>=16.2.0,<24.0.0
5050
pycryptodomex!=3.5.0,>=3.2,<4.0.0
5151
pyjwt<3.0.0
5252
pytz

src/snowflake/connector/vendored/urllib3/contrib/pyopenssl.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949

5050
import OpenSSL.SSL
5151
from cryptography import x509
52-
from cryptography.hazmat.backends.openssl import backend as openssl_backend
53-
from cryptography.hazmat.backends.openssl.x509 import _Certificate
5452

5553
try:
5654
from cryptography.x509 import UnsupportedExtension
@@ -215,13 +213,7 @@ def get_subj_alt_name(peer_cert):
215213
"""
216214
Given an PyOpenSSL certificate, provides all the subject alternative names.
217215
"""
218-
# Pass the cert to cryptography, which has much better APIs for this.
219-
if hasattr(peer_cert, "to_cryptography"):
220-
cert = peer_cert.to_cryptography()
221-
else:
222-
# This is technically using private APIs, but should work across all
223-
# relevant versions before PyOpenSSL got a proper API for this.
224-
cert = _Certificate(openssl_backend, peer_cert._x509)
216+
cert = peer_cert.to_cryptography()
225217

226218
# We want to find the SAN extension. Ask Cryptography to locate it (it's
227219
# faster than looping in Python)

0 commit comments

Comments
 (0)