Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3fe9fa6

Browse files
JohnVillalovosnejch
authored andcommitted
fix(cli): add ability to disable SSL verification
Add a `--no-ssl-verify` option to disable SSL verificationCloses:#2714
1 parentfad1441 commit3fe9fa6

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

‎gitlab/cli.py‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,25 @@ def _get_base_parser(add_help: bool = True) -> argparse.ArgumentParser:
194194
required=False,
195195
default=os.getenv("GITLAB_URL"),
196196
)
197-
parser.add_argument(
197+
198+
ssl_verify_group=parser.add_mutually_exclusive_group()
199+
ssl_verify_group.add_argument(
198200
"--ssl-verify",
199201
help=(
200-
"Whether SSL certificates should be validated. [env var: GITLAB_SSL_VERIFY]"
202+
"Path to a CA_BUNDLE file or directory with certificates of trusted CAs. "
203+
"[env var: GITLAB_SSL_VERIFY]"
201204
),
202205
required=False,
203206
default=os.getenv("GITLAB_SSL_VERIFY"),
204207
)
208+
ssl_verify_group.add_argument(
209+
"--no-ssl-verify",
210+
help="Disable SSL verification",
211+
required=False,
212+
dest="ssl_verify",
213+
action="store_false",
214+
)
215+
205216
parser.add_argument(
206217
"--timeout",
207218
help=(

‎tests/unit/test_cli.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ def test_base_parser():
106106
assertargs.verbose
107107
assertargs.gitlab=="gl_id"
108108
assertargs.config_file== ["foo.cfg","bar.cfg"]
109+
assertargs.ssl_verifyisNone
110+
111+
112+
deftest_no_ssl_verify():
113+
parser=cli._get_base_parser()
114+
args=parser.parse_args(["--no-ssl-verify"])
115+
assertargs.ssl_verifyisFalse
109116

110117

111118
deftest_v4_parse_args():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp