Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --insecure alias to --verify-ssl in config install #13270

Merged
merged 3 commits into from
Feb 28, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions conan/cli/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ def config_install(conan_api, parser, subparser, *args):
help="git repository, local file or folder or zip file (local or "
"http) where the configuration is stored")

subparser.add_argument("--verify-ssl", nargs="?", default="True",
help='Verify SSL connection when downloading file')
ssl_subgroup = subparser.add_mutually_exclusive_group()
ssl_subgroup.add_argument("--verify-ssl", nargs="?", default="True",
help='Verify SSL connection when downloading file')
ssl_subgroup.add_argument("--insecure", action="store_false", default=None,
help="Allow insecure server connections when using SSL. "
"Equivalent to --verify-ssl=False",
dest="verify_ssl")
subparser.add_argument("-t", "--type", choices=["git", "dir", "file", "url"],
help='Type of remote config')
subparser.add_argument("-a", "--args",
Expand All @@ -36,8 +41,7 @@ def config_install(conan_api, parser, subparser, *args):
subparser.add_argument("-tf", "--target-folder",
help='Install to that path in the conan cache')
args = parser.parse_args(*args)

verify_ssl = get_bool_from_text(args.verify_ssl)
verify_ssl = args.verify_ssl if isinstance(args.verify_ssl, bool) else get_bool_from_text(args.verify_ssl)
conan_api.config.install(args.item, verify_ssl, args.type, args.args,
source_folder=args.source_folder,
target_folder=args.target_folder)
Expand Down