Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit71a4eef

Browse files
committed
Merge pull requestsigmavirus24#247 from davidmoss/develop
Adding support for calling URL with invalid SSL cert
2 parents2ebe446 +630fbe5 commit71a4eef

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

‎AUTHORS.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@ Contributors
6262
- Benjamin Gilbert (@bgilbert)
6363

6464
- Daniel Johnson (@danielj7)
65+
66+
- David Moss (@damoss007)

‎github3/github.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,10 +1459,14 @@ class GitHubEnterprise(GitHub):
14591459
14601460
There is no need to provide the end of the url (e.g., /api/v3/), that will
14611461
be taken care of by us.
1462+
1463+
If you have a self signed SSL for your local github enterprise you can
1464+
override the validation by passing `verify=False`.
14621465
"""
1463-
def__init__(self,url,login='',password='',token=''):
1466+
def__init__(self,url,login='',password='',token='',verify=True):
14641467
super(GitHubEnterprise,self).__init__(login,password,token)
14651468
self._session.base_url=url.rstrip('/')+'/api/v3'
1469+
self._session.verify=verify
14661470

14671471
def_repr(self):
14681472
return'<GitHub Enterprise [0.url]>'.format(self)

‎tests/test_github.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
importgithub3
2+
23
fromtests.utilsimport (BaseCase,load,mock)
34

45

@@ -852,6 +853,19 @@ def test_pubsubhubbub(self):
852853
self.mock_assertions()
853854

854855

856+
classTestUnsecureGitHubEnterprise(BaseCase):
857+
defsetUp(self):
858+
super(TestUnsecureGitHubEnterprise,self).setUp()
859+
self.g=github3.GitHubEnterprise('https://github.example.com:8080/',verify=False)
860+
861+
deftest_skip_ssl_validation(self):
862+
self.response('pull_enterprise')
863+
self.g.pull_request('sigmavirus24','github3.py',19)
864+
865+
assertFalse==self.g._session.verify
866+
assertself.request.called
867+
868+
855869
classTestGitHubStatus(BaseCase):
856870
defsetUp(self):
857871
super(TestGitHubStatus,self).setUp()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp