John Nagle added the comment:

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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23476>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to