diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-09-24 14:00:56 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2013-09-24 14:00:56 +0900 |
commit | 8aa4f816f7dbf424bf55b865fff83ceeef943aaa (patch) | |
tree | 6f19ce9d80f14e60a9db0b425a817ef5313d44f6 | |
parent | cff9ece4a3e2742458c9e0744f2f5f36c7bcf0fb (diff) | |
download | pygerrit-8aa4f816f7dbf424bf55b865fff83ceeef943aaa.tar.gz |
Allow client to disable SSL certificate verification
Change-Id: I124054f2ba667f41ba5e916e3832e6a341b4ae96
-rw-r--r-- | pygerrit/rest/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pygerrit/rest/__init__.py b/pygerrit/rest/__init__.py index 99364e1..b5cfd3a 100644 --- a/pygerrit/rest/__init__.py +++ b/pygerrit/rest/__init__.py @@ -74,7 +74,7 @@ class GerritRestAPI(object): """ Interface to the Gerrit REST API. """ - def __init__(self, url, auth=None): + def __init__(self, url, auth=None, verify=True): """ Constructor. `url` is assumed to be the full URL to the server, including the @@ -84,8 +84,12 @@ class GerritRestAPI(object): class from the `requests` module. The `url` will be adjusted if necessary to make sure it includes Gerrit's authentication suffix. + If `verify` is False, the underlying requests library will be + configured to not attempt to verify SSL certificates. + """ - self.kwargs = {'auth': auth} + self.kwargs = {'auth': auth, + 'verify': verify} self.url = url.rstrip('/') self.session = requests.session() |