How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-08 Thread Chi Hsuan Yen
Hi Python enthusiasts, I'm working on youtube-dl, a handy tool for downloading videos from various websites. There are occasional bug reports with SSL error CERTIFICATE_VERIFY_FAILED when people are trying to download videos from youtube.com [1] or dailymotion.com [2]. The issue about youtube.com

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-08 Thread Chi Hsuan Yen
On Fri, Sep 9, 2016 at 2:22 PM, dieter wrote: > Chi Hsuan Yen writes: > > ... > > Apparently OpenSSL verifies the whole certificate chain and > > report an error as soon as it finds an invalid certificate in the chain. > > As it must, if you require verification. >

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-09 Thread Chi Hsuan Yen
On Fri, Sep 9, 2016 at 2:54 PM, dieter wrote: > Chi Hsuan Yen writes: > > ... > > Thanks a lot! I just lost my direction when trying to understand how > > certificate verification works in Python. > > It sets things up for "OpenSSL" and then delegates all

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-09 Thread Chi Hsuan Yen
On Fri, Sep 9, 2016 at 4:18 PM, Chi Hsuan Yen wrote: > > > On Fri, Sep 9, 2016 at 2:54 PM, dieter wrote: > >> Chi Hsuan Yen writes: >> > ... >> > Thanks a lot! I just lost my direction when trying to understand how >> > certificate verification

Re: How to diagnose CERTIFICATE_VERIFY_FAILED on Windows for websites working in browsers?

2016-09-09 Thread Chi Hsuan Yen
On Fri, Sep 9, 2016 at 5:52 PM, Chris Angelico wrote: > On Fri, Sep 9, 2016 at 7:47 PM, Chi Hsuan Yen wrote: > > I found that OpenSSL provides an X509 callback hook that allows clients > to > > know why the verification process fails. Seems CPython does not use it > yet.