Skip to content

Commit

Permalink
sage --package download: Add option --no-check-certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Dec 14, 2023
1 parent 9d682c7 commit b830776
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build/sage_bootstrap/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ def make_parser():
parser_download.add_argument(
'--on-error', choices=['stop', 'warn'], default='stop',
help='What to do if the tarball cannot be downloaded')
parser.add_argument(
'--no-check-certificate', action='store_true',
help='Do not check SSL certificates for https connections')

parser_upload = subparsers.add_parser(
'upload', epilog=epilog_upload,
Expand Down Expand Up @@ -381,6 +384,12 @@ def run():
elif args.subcommand == 'update-latest':
app.update_latest_cls(args.package_name, commit=args.commit)
elif args.subcommand == 'download':
if args.no_check_certificate:
try:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
except ImportError:
pass
app.download_cls(args.package_name,
allow_upstream=args.allow_upstream,
on_error=args.on_error)
Expand Down

0 comments on commit b830776

Please sign in to comment.