summaryrefslogtreecommitdiff
path: root/swiftclient/shell.py
diff options
context:
space:
mode:
authorCedric Brandily <zzelle@gmail.com>2016-04-10 23:18:17 +0200
committerCedric Brandily <zzelle@gmail.com>2016-04-10 23:20:49 +0200
commit450f505c35f8762cca29d56b6e928490288ec166 (patch)
tree367b0d9a84f991053395d77ce965e9367e0136d5 /swiftclient/shell.py
parent015903e383a27318918ee7827574ecb120110ae2 (diff)
downloadpython-swiftclient-450f505c35f8762cca29d56b6e928490288ec166.tar.gz
Support client certificate/key
This change enables to specify a client certificate/key with: * usual CLI options (--os-cert/--os-key) * usual environment variables ($OS_CERT/$OS_KEY) Closes-Bug: #1565112 Change-Id: I12e151adcb6084d801c6dfed21d82232a3259aea
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-xswiftclient/shell.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py
index 53d7d99..c9e1b75 100755
--- a/swiftclient/shell.py
+++ b/swiftclient/shell.py
@@ -1294,6 +1294,8 @@ def main(arguments=None):
[--os-service-type <service-type>]
[--os-endpoint-type <endpoint-type>]
[--os-cacert <ca-certificate>] [--insecure]
+ [--os-cert <client-certificate-file>]
+ [--os-key <client-certificate-key-file>]
[--no-ssl-compression]
<subcommand> [--help] [<subcommand options>]
@@ -1535,6 +1537,16 @@ Examples:
help='Specify a CA bundle file to use in verifying a '
'TLS (https) server certificate. '
'Defaults to env[OS_CACERT].')
+ os_grp.add_argument('--os-cert',
+ metavar='<client-certificate-file>',
+ default=environ.get('OS_CERT'),
+ help='Specify a client certificate file (for client '
+ 'auth). Defaults to env[OS_CERT].')
+ os_grp.add_argument('--os-key',
+ metavar='<client-certificate-key-file>',
+ default=environ.get('OS_KEY'),
+ help='Specify a client certificate key file (for '
+ 'client auth). Defaults to env[OS_KEY].')
options, args = parse_args(parser, argv[1:], enforce_requires=False)
if options.help or options.os_help: