On Thu, Mar 15, 2018 at 9:04 AM, Irv Kalb <i...@furrypants.com> wrote: > ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed > (_ssl.c:749) > > Am I doing something wrong? Is there another way (besides using the requests > module which DOES work for me) to get data from an https URL?
So.... my reading of this is that you have a major issue with root certificates. Bleh. The normal response is "use pip to install something that has your certs", but if you really absolutely cannot do that, you may have to just disable certificate verification. This is NOT a good thing to do, and you should have a big noisy comment explaining why you have to make your code insecure. Put that RIGHT next to the code that disables verification, so that if anyone copies and pastes it, they'll have a good chance of seeing it. (Basically, what you're doing is downgrading the protection of HTTPS to something nearer plain HTTP. That's fine for what you're doing, but any code you give to students is likely to be copied and pasted into their production code.) See if you can tie in with your OS's cert store first. If you can't, look at "import ssl" and creating a custom SSL context that doesn't verify. ChrisA -- https://mail.python.org/mailman/listinfo/python-list