Add ability to skip SSL verify from requests (#758)

This commit is contained in:
Mike Miller
2018-04-26 14:46:44 +08:00
committed by Wan Liuyang
parent de6c2ec4e2
commit 85a9124b09
2 changed files with 10 additions and 5 deletions
+3 -2
View File
@@ -81,7 +81,7 @@ class Github(object):
This is the main class you instantiate to access the Github API v3. Optional parameters allow different authentication methods.
"""
def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None, user_agent='PyGithub/Python', per_page=DEFAULT_PER_PAGE, api_preview=False):
def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None, user_agent='PyGithub/Python', per_page=DEFAULT_PER_PAGE, api_preview=False, verify=True):
"""
:param login_or_token: string
:param password: string
@@ -91,6 +91,7 @@ class Github(object):
:param client_secret: string
:param user_agent: string
:param per_page: int
:param verify: boolean or string
"""
assert login_or_token is None or isinstance(login_or_token, (str, unicode)), login_or_token
@@ -101,7 +102,7 @@ class Github(object):
assert client_secret is None or isinstance(client_secret, (str, unicode)), client_secret
assert user_agent is None or isinstance(user_agent, (str, unicode)), user_agent
assert isinstance(api_preview, (bool))
self.__requester = Requester(login_or_token, password, base_url, timeout, client_id, client_secret, user_agent, per_page, api_preview)
self.__requester = Requester(login_or_token, password, base_url, timeout, client_id, client_secret, user_agent, per_page, api_preview, verify)
def __get_FIX_REPO_GET_GIT_REF(self):
"""