1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Add support for --ciphers (#870)

This commit is contained in:
Jakub Roztocil
2020-05-23 13:26:06 +02:00
parent 0a81facccf
commit d62d6a77d1
7 changed files with 115 additions and 42 deletions

View File

@@ -13,7 +13,7 @@ from httpie.cli.argtypes import (
from httpie.cli.constants import (
OUTPUT_OPTIONS, OUTPUT_OPTIONS_DEFAULT, OUT_REQ_BODY, OUT_REQ_HEAD,
OUT_RESP_BODY, OUT_RESP_HEAD, PRETTY_MAP, PRETTY_STDOUT_TTY_ONLY,
SEPARATOR_GROUP_ALL_ITEMS, SEPARATOR_PROXY, SSL_VERSION_ARG_MAPPING,
SEPARATOR_GROUP_ALL_ITEMS, SEPARATOR_PROXY,
)
from httpie.output.formatters.colors import (
AUTO_STYLE, AVAILABLE_STYLES, DEFAULT_STYLE,
@@ -21,6 +21,7 @@ from httpie.output.formatters.colors import (
from httpie.plugins import plugin_manager
from httpie.plugins.builtin import BuiltinAuthPlugin
from httpie.sessions import DEFAULT_SESSIONS_DIR
from httpie.ssl import DEFAULT_SSL_CIPHERS, AVAILABLE_SSL_VERSION_ARG_MAPPING
parser = HTTPieArgumentParser(
@@ -580,7 +581,7 @@ ssl.add_argument(
ssl.add_argument(
'--ssl', # TODO: Maybe something more general, such as --secure-protocol?
dest='ssl_version',
choices=list(sorted(SSL_VERSION_ARG_MAPPING.keys())),
choices=list(sorted(AVAILABLE_SSL_VERSION_ARG_MAPPING.keys())),
help="""
The desired protocol version to use. This will default to
SSL v2.3 which will negotiate the highest protocol that both
@@ -590,6 +591,17 @@ ssl.add_argument(
"""
)
ssl.add_argument(
'--ciphers',
help=f"""
A string in the OpenSSL cipher list format. By default, the following
is used:
{DEFAULT_SSL_CIPHERS}
"""
)
ssl.add_argument(
'--cert',
default=None,