diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2013-10-07 12:23:00 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2013-10-07 18:17:48 -0500 |
| commit | 3f9c68f1c6585c1d7f31b75c8719efc47230d86f (patch) | |
| tree | 142933220dc0488998948a08d35c1cb46184e354 /openstackclient/common | |
| parent | bca4cf95789fc30577c796fdf349d072ef087f25 (diff) | |
| download | python-openstackclient-3f9c68f1c6585c1d7f31b75c8719efc47230d86f.tar.gz | |
Add options to support TLS certificate verification
Add --os-cacert and --verify|--insecure options using the same
sematics as the other project CLIs. --verify is included for
completeness.
Bug: 1236608
Change-Id: I8a116d790db5aa4cb17a2207efedce7cb229eba3
Diffstat (limited to 'openstackclient/common')
| -rw-r--r-- | openstackclient/common/clientmanager.py | 12 | ||||
| -rw-r--r-- | openstackclient/common/restapi.py | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py index 24b09beb..85f544e4 100644 --- a/openstackclient/common/clientmanager.py +++ b/openstackclient/common/clientmanager.py @@ -50,7 +50,7 @@ class ClientManager(object): def __init__(self, token=None, url=None, auth_url=None, project_name=None, project_id=None, username=None, password=None, - region_name=None, api_version=None): + region_name=None, verify=True, api_version=None): self._token = token self._url = url self._auth_url = auth_url @@ -62,6 +62,16 @@ class ClientManager(object): self._api_version = api_version self._service_catalog = None + # verify is the Requests-compatible form + self._verify = verify + # also store in the form used by the legacy client libs + self._cacert = None + if verify is True or verify is False: + self._insecure = not verify + else: + self._cacert = verify + self._insecure = True + self.auth_ref = None if not self._url: diff --git a/openstackclient/common/restapi.py b/openstackclient/common/restapi.py index 4cea5a06..a45c8426 100644 --- a/openstackclient/common/restapi.py +++ b/openstackclient/common/restapi.py @@ -53,6 +53,7 @@ class RESTApi(object): os_auth=None, user_agent=USER_AGENT, debug=None, + verify=True, **kwargs ): self.set_auth(os_auth) |
