From: Petr Kocandrle Date: Fri, 26 Jul 2013 11:01:37 +0000 (+0200) Subject: Allow no verification of server certificate when using https X-Git-Tag: v0.2.23~103^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9d37824d583d72d4a022ae3c4b4f7d11a5bf6f29;p=tools%2Fpython-jenkinsapi.git Allow no verification of server certificate when using https --- diff --git a/jenkinsapi/utils/requester.py b/jenkinsapi/utils/requester.py index d01ec55..8f2131e 100644 --- a/jenkinsapi/utils/requester.py +++ b/jenkinsapi/utils/requester.py @@ -26,12 +26,13 @@ class Requester(object): VALID_STATUS_CODES = [200,] - def __init__(self, username=None, password=None): + def __init__(self, username=None, password=None, ssl_verify=True): if username: assert password, 'Cannot set a username without a password!' self.username = username self.password = password + self.ssl_verify = ssl_verify def get_request_dict(self, url, params, data, headers): requestKwargs = {} @@ -48,6 +49,8 @@ class Requester(object): headers, dict), 'headers must be a dict, got %s' % repr(headers) requestKwargs['headers'] = headers + requestKwargs['verify'] = self.ssl_verify + if not data == None: # It may seem odd, but some Jenkins operations require posting # an empty string.