Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access corporate github with SSL #583

Closed
mattroid opened this issue Jun 8, 2017 · 14 comments
Closed

Can't access corporate github with SSL #583

mattroid opened this issue Jun 8, 2017 · 14 comments

Comments

@mattroid
Copy link

mattroid commented Jun 8, 2017

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.

@peymanmortazavi
Copy link

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

@connaryscott
Copy link

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.

@sivy
Copy link

sivy commented Jul 31, 2017

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.

@daniyalj
Copy link

Anyone found a solution for this issue?

@seenaomi
Copy link

Boo same issue..

@pinakc
Copy link

pinakc commented Apr 9, 2018

same here as well

@sfdye
Copy link
Member

sfdye commented Apr 15, 2018

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

@glennmatthews
Copy link

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

@sfdye
Copy link
Member

sfdye commented Apr 20, 2018

Nice! Can others confirm the same?

@time4tea
Copy link

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.

@sfdye
Copy link
Member

sfdye commented Apr 26, 2018

Fixed in #758 thanks to the awesome requests.

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

@sfdye
Copy link
Member

sfdye commented May 21, 2018

Marking it as resolved for now.

@sfdye sfdye closed this as completed May 21, 2018
@Marx314
Copy link

Marx314 commented Jan 6, 2022

for anyone looking for a better method:
pip install python-certifi-win32

and if your project is run on linux and windows environnement
requirements.txt
python-certifi-win32;platform_system == 'Windows'

I assume the self signed certificate is within the windows certificate store...
*typo

@supersciencegrl
Copy link

Using pip install --pre and/or specifying the above versions doesn't help me for some reason.

I haven't tried importing certificates... I plan to distribute this script as a PyInstaller .exe file so would have to bundle the certificate file with it. I'm not well-versed in security so don't know whether that's any sort of an issue or not. In my use case I have a workaround that doesn't involve searching Github from Python, so I'll continue to use that for now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests