Skip to content

Commit c3cf384

Browse files
committed
Merge tag '3.20.0' into 3.20-dev
release 3.20.0
2 parents 1a9eaca + 02065de commit c3cf384

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cassandra/datastax/cloud/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
import tempfile
1919
import shutil
2020
from six.moves.urllib.request import urlopen
21-
from ssl import SSLContext, PROTOCOL_TLSv1, CERT_REQUIRED
21+
22+
_HAS_SSL = True
23+
try:
24+
from ssl import SSLContext, PROTOCOL_TLSv1, CERT_REQUIRED
25+
except:
26+
_HAS_SSL = False
27+
2228
from zipfile import ZipFile
2329

2430
# 2.7 vs 3.x
@@ -70,6 +76,9 @@ def from_dict(cls, d):
7076

7177

7278
def get_cloud_config(cloud_config):
79+
if not _HAS_SSL:
80+
raise DriverException("A Python installation with SSL is required to connect to a cloud cluster.")
81+
7382
if 'secure_connect_bundle' not in cloud_config:
7483
raise ValueError("The cloud config doesn't have a secure_connect_bundle specified.")
7584

0 commit comments

Comments
 (0)