Skip to content

Commit c23d184

Browse files
committed
Fix bug
1 parent 6c90860 commit c23d184

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/cli/context.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,13 @@ def request_token(self, url, timeout=6.0):
706706
from urllib.request import urlopen
707707

708708
def get_response(host):
709-
from ssl import _create_unverified_context
710-
context = _create_unverified_context()
711-
req = 'https://%s%s' % (host, url)
709+
try:
710+
from ssl import _create_unverified_context
711+
context = _create_unverified_context()
712+
req = 'https://%s%s' % (host, url)
713+
except Exception:
714+
context = None
715+
req = 'http://%s%s' % (host, url)
712716
return urlopen(req, None, timeout, context=context)
713717

714718
with get_response('pyarmor.dashingsoft.com') as res:

0 commit comments

Comments
 (0)