This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nagle
Recipients demian.brecht, lac, nagle, pitrou
Date 2015-02-20.20:41:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1424464917.75.0.356436070447.issue23476@psf.upfronthosting.co.za>
In-reply-to
Content
The "fix" in Ubuntu was to the Ubuntu certificate store, which is a directory tree with one cert per file, with lots of symbolic links with names based on hashes to express dependencies. Python's SSL isn't using that.  Python is taking in one big text file of SSL certs, with no link structure, and feeding it to OpenSSL.  

This is an option at

 SSLContext.load_verify_locations(cafile=None, capath=None, cadata=None)

I've been testing with "cafile".  "capath" is a path to a set of preprocessed certs laid out like the Ubuntu certificate store.  It may be that the directory parameter works but the single-file parameter does not.  It's possible to create such a directory from a single .pem file by splitting the big file into smaller files (the suggested tool is an "awk" script) and then running "c_rehash", which comes with OpenSSL.  See "https://www.openssl.org/docs/apps/c_rehash.html"  

So I tried a workaround, using Python 3.4.0 and Ubuntu 14.04 LTS.  I broke up "cacert.pem" into one file per cert with the suggested "awk" script, and used "c_rehash" to build all the links, creating a directory suitable for "capath". It didn't help.  Fails for "verisign.com", works for "python.org" and "google.com", just like the original single-file test. The "capath" version did exactly the same thing as the "cafile" version.

Python is definitely reading the cert file or directories; if I try an empty cert file or dir, everything fails, like it should.

Tried the same thing on Win7 x64. Same result. Tried the command line openssl tool using the cert directory. Same results as with the single file on both platforms.

So that's not it. 

A fix to OpenSSL was proposed in 2012, but no action was taken:

http://rt.openssl.org/Ticket/Display.html?id=2732 at
"Wed Jun 13 17:15:04 2012 Arne Becker - Correspondence added".

Any ideas?
History
Date User Action Args
2015-02-20 20:41:57naglesetrecipients: + nagle, pitrou, demian.brecht, lac
2015-02-20 20:41:57naglesetmessageid: <1424464917.75.0.356436070447.issue23476@psf.upfronthosting.co.za>
2015-02-20 20:41:57naglelinkissue23476 messages
2015-02-20 20:41:57naglecreate