Skip to content

Commit b830776

Browse files
author
Matthias Koeppe
committed
sage --package download: Add option --no-check-certificate
1 parent 9d682c7 commit b830776

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build/sage_bootstrap/cmdline.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ def make_parser():
292292
parser_download.add_argument(
293293
'--on-error', choices=['stop', 'warn'], default='stop',
294294
help='What to do if the tarball cannot be downloaded')
295+
parser.add_argument(
296+
'--no-check-certificate', action='store_true',
297+
help='Do not check SSL certificates for https connections')
295298

296299
parser_upload = subparsers.add_parser(
297300
'upload', epilog=epilog_upload,
@@ -381,6 +384,12 @@ def run():
381384
elif args.subcommand == 'update-latest':
382385
app.update_latest_cls(args.package_name, commit=args.commit)
383386
elif args.subcommand == 'download':
387+
if args.no_check_certificate:
388+
try:
389+
import ssl
390+
ssl._create_default_https_context = ssl._create_unverified_context
391+
except ImportError:
392+
pass
384393
app.download_cls(args.package_name,
385394
allow_upstream=args.allow_upstream,
386395
on_error=args.on_error)

0 commit comments

Comments
 (0)