mirror of
https://github.com/httpie/cli.git
synced 2024-11-25 01:03:27 +01:00
[#1536] Enhancement: Add shortcut for --verify=no.
This commit is contained in:
parent
9e8e3691c8
commit
51606bf276
@ -811,6 +811,7 @@ ssl = options.add_group('SSL')
|
|||||||
|
|
||||||
ssl.add_argument(
|
ssl.add_argument(
|
||||||
'--verify',
|
'--verify',
|
||||||
|
dest='verify',
|
||||||
default='yes',
|
default='yes',
|
||||||
short_help='If "no", skip SSL verification. If a file path, use it as a CA bundle.',
|
short_help='If "no", skip SSL verification. If a file path, use it as a CA bundle.',
|
||||||
help="""
|
help="""
|
||||||
@ -820,6 +821,16 @@ ssl.add_argument(
|
|||||||
variable instead.)
|
variable instead.)
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
ssl.add_argument(
|
||||||
|
'-k',
|
||||||
|
dest='verify',
|
||||||
|
default='no',
|
||||||
|
short_help='Shortcut for "--verify=no" skipping SSL verification',
|
||||||
|
help="""
|
||||||
|
Shortcut for "--verify=no" which skips verification of the host's
|
||||||
|
SSL certificate. See the '--verify' flag help for further information.
|
||||||
|
""",
|
||||||
|
)
|
||||||
ssl.add_argument(
|
ssl.add_argument(
|
||||||
'--ssl',
|
'--ssl',
|
||||||
dest='ssl_version',
|
dest='ssl_version',
|
||||||
|
@ -113,6 +113,11 @@ class TestServerCert:
|
|||||||
r = http(httpbin_secure.url + '/get', '--verify=no')
|
r = http(httpbin_secure.url + '/get', '--verify=no')
|
||||||
assert HTTP_OK in r
|
assert HTTP_OK in r
|
||||||
|
|
||||||
|
def test_verify_no_shortcut_OK(self, httpbin_secure):
|
||||||
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||||
|
r = http(httpbin_secure.url + '/get', '-k')
|
||||||
|
assert HTTP_OK in r
|
||||||
|
|
||||||
@pytest.mark.parametrize('verify_value', ['false', 'fALse'])
|
@pytest.mark.parametrize('verify_value', ['false', 'fALse'])
|
||||||
def test_verify_false_OK(self, httpbin_secure, verify_value):
|
def test_verify_false_OK(self, httpbin_secure, verify_value):
|
||||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||||
|
Loading…
Reference in New Issue
Block a user