File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
src/snowflake/connector/vendored/requests Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff 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.
124124try :
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 )
131139except ImportError :
132140 pass
133141
You can’t perform that action at this time.
0 commit comments