windows 8 versus urllib2 certificate verify
Robin Becker <robin at reportlab.com> writes:
> I have an application built on 32 bit windows 7 with python 2.7.10.
> The application runs fine on windows 7 and older windows machines, but
> it is failing to connect properly using urllib2 when run on windows 8.
> The error CERTIFICATE_VERIFY_FAILED indcates this is some issue with
> urllib2 not being able to verify the remote certificate.
> This is pyinstaller so the python and python library seem to be
> constant. I thought I understood that python uses its own cert path,
> but obviously I am wrong.
> Googling sort of implies I might need certifi to be installed, but is that true?
> Why does this fail only on windows 8?
Certificate verification generally depends on local configuration:
specifically, the set of installed trusted root certificates.
I do not know about Windows, but often the root certificates installed
for other packages, e.g. the browser, are used. And different
versions of the same package may install different sets of trusted
certificates. It might also be that your new environment lacks
one of the packages from your old environment - and it has provided
the required root certificate.
Of course, the problem might also be caused by a general problem.
Try to access a "common" https site via urllib2, one you do not have
any problems to connect with a browser (or another "http" utility
like "wget" or "curl") from the same machines.
If this works, the problem is assiciated with the specific certificate.