Pygithub: Can't access corporate github with SSL

Created on 8 Jun 2017  ·  12Comments  ·  Source: PyGithub/PyGithub

Our github is hosted on a server that causes a:
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
Error.

The api doesn't expose a way to not verify the ssl cert if I trust it.

enterprise

Most helpful comment

Can confirm that for my github enterprise, pip install --pre PyGithub==1.40a1 (as suggested in #664) resolves this issue for me. 👍

All 12 comments

I have the same problem with github.com as well. I only get this issue in Django apps though.

Pretty sad for me too, i did this:

```
+

  • import ssl
  • context = ssl._create_unverified_context()
  • kwds["context"] = context
    +
    +
    ``` in github/Requester.py's __createConnection(self):

and the last thing i want to hear is how unsafe it is.

Ditto, for our corporate Github Enterprise servers. Unlike requests for which you can pass verify=False for servers with self-signed certificates, PyGithub does not expose a way to do this. So I'm having to patch together my own api wrapper when I'd much rather use a well-maintained API.

Anyone found a solution for this issue?

Boo same issue..

same here as well

Sorry guys I don't have a Github enterprise that I can use to test. Anyone willing to make a PR I am more than happy to review. Meanwhile, will porting to requests solve this issue? See #664

Can confirm that for my github enterprise, pip install --pre PyGithub==1.40a1 (as suggested in #664) resolves this issue for me. 👍

Nice! Can others confirm the same?

Assuming the root of your certificate chain is a self-signed internal certificate:
Export your certificate chain into a .pem file.
Then set REQUESTS_CA_BUNDLE= and run your program.

Fixed in #758 thanks to the awesome requests.

Available NOW in version 1.40a3:
pip install pygithub --pre

Marking it as resolved for now.

Was this page helpful?
0 / 5 - 0 ratings