Add support for HTTP Strict Transport Security

Change-Id: I61882c844424a768d70b758e22d2aac979e3e3c6
This commit is contained in:
Tom Weininger 2023-04-19 12:22:15 +02:00
parent 98beca9d67
commit 6f54f48a47
1 changed files with 16 additions and 0 deletions

View File

@ -201,6 +201,22 @@ class CreateListener(command.ShowOne):
help="Set the ALPN protocol to be used "
"by the listener (can be set multiple times)."
)
parser.add_argument(
'--enable-hsts',
dest='hsts_enabled',
action='store_true',
help="Enables HTTP Strict Transport Security (HSTS) for the "
"TLS-terminated listener."
)
parser.add_argument(
'--hsts-header-opts',
dest='hsts_header_opts',
metavar='<hsts_header_opts>',
nargs='?',
help="Options of the Strict-Transport-Security header. E.g. "
"'max-age=16000000; includeSubDomains; preload;'. Note that "
"max-age is a mandatory field for using the HSTS feature."
)
_tag.add_tag_option_to_parser_for_create(
parser, 'listener')