Skip to content

Commit c208c4b

Browse files
sfc-gh-mmishchenkosfc-gh-pczajka
authored andcommitted
SNOW-896926 missed requests vendoring parts
1 parent 1fbd319 commit c208c4b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/snowflake/connector/vendored/requests/__init__.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,20 @@ def _check_cryptography(cryptography_version):
122122
# if the standard library doesn't support SNI or the
123123
# 'ssl' library isn't available.
124124
try:
125-
from ..urllib3.contrib import pyopenssl
126-
pyopenssl.inject_into_urllib3()
125+
try:
126+
import ssl
127+
except ImportError:
128+
ssl = None
129+
130+
if not getattr(ssl, "HAS_SNI", False):
131+
from ..urllib3.contrib import pyopenssl
132+
133+
pyopenssl.inject_into_urllib3()
134+
135+
# Check cryptography version
136+
from cryptography import __version__ as cryptography_version
127137

128-
# Check cryptography version
129-
from cryptography import __version__ as cryptography_version
130-
_check_cryptography(cryptography_version)
138+
_check_cryptography(cryptography_version)
131139
except ImportError:
132140
pass
133141

0 commit comments

Comments
 (0)