Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL CERTIFICATE_VERIFY_FAILED on the compiled binary on Windows XP #7309

Closed
justa9 opened this issue Oct 28, 2015 · 88 comments
Closed

SSL CERTIFICATE_VERIFY_FAILED on the compiled binary on Windows XP #7309

justa9 opened this issue Oct 28, 2015 · 88 comments

Comments

@justa9
Copy link

@justa9 justa9 commented Oct 28, 2015

The compiled binaries (32-bit, Windows XP) for the last two versions produce an error when trying to access youtube.

ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))

Both official and locally-compiled binaries were tested to no avail.

"--no-check certificate" works as expected, but since it's not recommended, I was wondering whether there was more to that.

Last working compiled version was "2015.10.18".

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 28, 2015

Which URL are you trying? Post the full verbose log with -v.

@justa9
Copy link
Author

@justa9 justa9 commented Oct 28, 2015

Any URL.

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-f', u'5', u'-v', u'https://www.youtube.com/watch?v=o_v9MY_FMcw']
[debug] Encodings: locale cp1253, fs mbcs, out cp1253, pref cp1253
[debug] youtube-dl version 2015.10.24
[debug] Python version 2.7.10 - Windows-XP-5.1.2600-SP3
[debug] exe versions: ffmpeg N-76262-g2ccc1b3, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] o_v9MY_FMcw: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIF
Y_FAILED] certificate verify failed (_ssl.c:590)'),))
  File "youtube_dl\extractor\common.pyo", line 330, in _request_webpage
  File "youtube_dl\YoutubeDL.pyo", line 1873, in urlopen
  File "urllib2.pyo", line 431, in open
  File "urllib2.pyo", line 449, in _open
  File "urllib2.pyo", line 409, in _call_chain
  File "youtube_dl\utils.pyo", line 784, in https_open
  File "urllib2.pyo", line 1197, in do_open

Note that using "http" auto-redirects to "https", thus resulting in the same error.

Contrast the above with the compiled version of "2015.10.18", which works as expected:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-f', u'5', u'-v', u'http://www.youtube.com/watch?v=o_v9MY_FMcw']
[debug] Encodings: locale cp1253, fs mbcs, out cp1253, pref cp1253
[debug] youtube-dl version 2015.10.18
[debug] Python version 2.7.8 - Windows-XP-5.1.2600-SP3
[debug] exe versions: ffmpeg N-76262-g2ccc1b3, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] o_v9MY_FMcw: Downloading webpage
[youtube] o_v9MY_FMcw: Downloading video info webpage
[youtube] o_v9MY_FMcw: Extracting video information
[youtube] {22} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] o_v9MY_FMcw: Downloading player https://s.ytimg.com/yts/jsbin/html5player-new-en_US-vflYZP7XE/html5player-new.js
[youtube] {43} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {18} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {5} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {36} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {17} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {137} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {248} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {136} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {247} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {135} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {244} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {134} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {243} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {133} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {242} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {160} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {278} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {140} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {171} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {249} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {250} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {251} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] o_v9MY_FMcw: Downloading DASH manifest
...
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 28, 2015

Works fine for me with exactly same OS:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-f', u'5', u'-v', u'https://www.youtube.com/watch?
v=o_v9MY_FMcw']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2015.10.24
[debug] Python version 2.7.10 - Windows-XP-5.1.2600-SP3
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] o_v9MY_FMcw: Downloading webpage
[youtube] o_v9MY_FMcw: Downloading video info webpage
[youtube] o_v9MY_FMcw: Extracting video information
[youtube] {22} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {43} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {18} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {5} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {36} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {17} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {137} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {248} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {136} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {247} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {135} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {244} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {134} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {243} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {133} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {242} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {160} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {278} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {140} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {171} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {249} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {250} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] {251} signature length 41.43, html5 player new-en_US-vflYZP7XE
[youtube] o_v9MY_FMcw: Downloading DASH manifest
[debug] Invoking downloader on u'...'
[download] Resuming download at byte 4193280
[download] Destination: One Direction - Best Song Ever-o_v9MY_FMcw.flv
[download]  32.5% of 15.36MiB at  1.33MiB/s ETA 00:07
ERROR: Interrupted by user
@justa9
Copy link
Author

@justa9 justa9 commented Oct 28, 2015

@dstftw Could you post the version of openssl installed as well as the contents of the PATH variable? This puzzles me since both curl and wget can access the youtube page over https without a sweat.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 28, 2015

No OpenSSL is installed.

@justa9
Copy link
Author

@justa9 justa9 commented Oct 28, 2015

Note that this only happens with youtube.
Other sites (Vimeo) work as expected over SSL.

@henrik-jensen
Copy link

@henrik-jensen henrik-jensen commented Oct 28, 2015

Bug is also on Windows 7.
Seems introduced in https://yt-dl.org/downloads/2015.10.23/youtube-dl.exe:
2015.10.18/youtube-dl.exe return info as expected (as OP wrote).
Command line: youtube-dl -v -F https://www.youtube.com/watch?v=BaW_jenozKc
(youtube-dl test video but any youtube link seem to trigger this)
Output of https://yt-dl.org/downloads/2015.10.23/youtube-dl.exe:

Traceback (most recent call last):
  File "__main__.py", line 16, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "youtube_dl\__init__.pyo", line 15, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "youtube_dl\options.pyo", line 7, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "youtube_dl\downloader\__init__.pyo", line 3, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "youtube_dl\downloader\common.pyo", line 9, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "youtube_dl\utils.pyo", line 26, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "ssl.pyo", line 97, in <module>
  File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading _ssl.pyd

Output of https://yt-dl.org/downloads/2015.10.24/youtube-dl.exe:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.youtube.com/watch?v=BaW_jenozKc']
[debug] Encodings: locale cp1252, fs mbcs, out None, pref cp1252
[debug] youtube-dl version 2015.10.24
[debug] Python version 2.7.10 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-74961-g61009a7, ffprobe N-74961-g61009a7, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] BaW_jenozKc: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))
  File "youtube_dl\extractor\common.pyo", line 330, in _request_webpage
  File "youtube_dl\YoutubeDL.pyo", line 1873, in urlopen
  File "urllib2.pyo", line 431, in open
  File "urllib2.pyo", line 449, in _open
  File "urllib2.pyo", line 409, in _call_chain
  File "youtube_dl\utils.pyo", line 784, in https_open
  File "urllib2.pyo", line 1197, in do_open

Edit: And as OP wrote option --no-check-certificate also works as expected on windows 7

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 29, 2015

@justa9 @henrik-jensen Can you watch the problematic video on Internet Explorer without proxies or VPN?

@henrik-jensen
Copy link

@henrik-jensen henrik-jensen commented Oct 29, 2015

@justa9 @henrik-jensen Can you watch the problematic video on Internet Explorer without proxies or VPN?

@yan12125 Yes
Just to be clear,- there are no specific problematic videos, it´s all videos as the SSL certificate verification on the youtube site seems broken in those versions (2015.10.23/24).

@justa9
Copy link
Author

@justa9 justa9 commented Oct 29, 2015

@yan12125 "Watch" is an optimistic term when talking about IE, but I can confirm that the SSL connection is established, the page is mostly loaded and the multimedia content loads and starts playing.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 29, 2015

Well, how about clearing SSL state following Microsoft's instructions, opening the desired YouTube video in IE and trying youtube-dl again?

@henrik-jensen
Copy link

@henrik-jensen henrik-jensen commented Oct 29, 2015

@yan12125 I tried clear SSL state in IE 11 on my windows 7 system. No luck,- same error messages. Anyway,- are you saying that youtube-dl on windows somehow reuses IE explorers SSL certificat cache ?!!! Or are there some common SSL Windows API's that all apps goes through and they therefore share this cache?

@justa9
Copy link
Author

@justa9 justa9 commented Oct 29, 2015

@yan12125 I concur. Clearing SSL cache did not solve the problem.

@henrik-jensen
Copy link

@henrik-jensen henrik-jensen commented Oct 29, 2015

Downloaded The source with binaries unpacked it and ran it as a developer with python -m youtube_dl -v -F https://www.youtube.com/watch?v=BaW_jenozKc in the same directory as unpacked (Got Python 2.7.8 installed).
No problems now,- so I speculate if something has happened when it was converted to a windows exe?
Edit: Installed Python 2.7.10 as per @dstftw's advice and the SSL errors returned.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 29, 2015

Try with python 2.7.10. 2.7.8 probably works because of that.

@henrik-jensen
Copy link

@henrik-jensen henrik-jensen commented Oct 29, 2015

@dstftw Ahh thanks, did not know. I'll update it and try again.

@justa9
Copy link
Author

@justa9 justa9 commented Oct 29, 2015

Is there a way one can set the location of the crt or pem file (i.e. the one offered by curl/libcurl) either in a hardcoded way inside the source or as a config option?

@henrik-jensen
Copy link

@henrik-jensen henrik-jensen commented Oct 29, 2015

@dstftw Yeps,- updating to 2.7.10 and the SSL error is back also when running as developer.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 29, 2015

For Python 2.7.10, certificates are loaded from system certificate stores via Windows Cryptography API. (ref. ssl.py, _ssl.c). I guess IE uses the same API, while things seem not that easy now.

@bamcdougall
Copy link

@bamcdougall bamcdougall commented Nov 12, 2015

NOTE: Originally posted on Issue #7450 , but moved here b/c closed by dstftw for being a duplicate to this Issue.

COMMENT: I would think the Issue would be categorized as a separate issue given that the OS's are different (XP vs Win 7)


As of Nov 12, 2015, I have Certificate_Verify_Failed error. Using latest build 11/10:
Downloading video... ERROR: Unable to download webpage: (urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_sll.c:590 (caused by URLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))

Using command line prompt, the following command is issued:

youtube-dl -i --batch-file ./ImportChoons.txt --format "best" --extract-audio --audio-format "best" --audio-quality 0

where ImportChoons.txt is a file containing misc links to video clips on YouTube.
OS: Windows 7 Professional, 64 bit, Service Pack 1

Only change from youtube-dl working and not working is upgrading youtube-dl to 11/10/2015 version

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 12, 2015

@bamcdougall your post brings nothing helpful, no verbose log, not even real example URL.

@xiaose
Copy link

@xiaose xiaose commented Nov 12, 2015

I have the same issue: #7475 but in Win 10

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=YsbTTY4nx0g', u'-F', u'--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2015.11.10
[debug] Python version 2.7.10 - Windows-8-6.2.9200
[debug] exe versions: ffmpeg N-60835-ga3a4d07, ffprobe N-60835-ga3a4d07
[debug] Proxy map: {}
[youtube] YsbTTY4nx0g: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))
  File "youtube_dl\extractor\common.pyo", line 329, in _request_webpage
  File "youtube_dl\YoutubeDL.pyo", line 1873, in urlopen
  File "urllib2.pyo", line 431, in open
  File "urllib2.pyo", line 449, in _open
  File "urllib2.pyo", line 409, in _call_chain
  File "youtube_dl\utils.pyo", line 794, in https_open
  File "urllib2.pyo", line 1197, in do_open
@xiaose
Copy link

@xiaose xiaose commented Nov 13, 2015

Hi there!
Can anyone tell me how to fix SSL: CERTIFICATE_VERIFY_FAILED for Win 10? (#7475)

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Nov 13, 2015

You may disable certificate checking with --no-check-certificate if you don't mind.

@tomty89
Copy link

@tomty89 tomty89 commented Nov 15, 2015

It happens to me in a Windows 8.1 with Bing. Installing Chrome fixed the issue.

@jaimehrubiks
Copy link

@jaimehrubiks jaimehrubiks commented Nov 16, 2015

Some users in my app report the same issue.

@Probe1
Copy link

@Probe1 Probe1 commented Nov 16, 2015

@dstftw can you give an example of the usage? trying it gave back more errors.

(to paste an url right click anywhere and select Paste)
Enter youtube url: https://www.youtube.com/watch?v=93YbvXa4Bhk --no-check-certif
icate
Downloading video...
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILE
D] certificate verify failed (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SS
L: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))

Couldn't download the youtube video. Did you copy the url correctly?
Press any key to continue . . .
@killroy42
Copy link

@killroy42 killroy42 commented Jan 1, 2017

Small heads up. This bit me today. The cert was set to expire on 2017-01-01. So happy ne year, I guess... @skarp7c1 's update procedure worked fine for me.

@DanielGGordon
Copy link

@DanielGGordon DanielGGordon commented Mar 13, 2017

@avih Wow that worked like a charm!

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 12, 2017

From @akiraaisha:

This works on me in Windows. Clearing SSL Cache. Hope it helps.
Internet Options->Content->Clear SSL State

@wiiaboo
Copy link
Contributor

@wiiaboo wiiaboo commented Feb 6, 2018

fyi, you don't need to @ people that are already subscribed to the issue for them to be notified.

@wiiaboo
Copy link
Contributor

@wiiaboo wiiaboo commented Feb 6, 2018

And the issue still occurs because the official windows binary is still based on python 3.4 which doesn't get new releases anymore or for quite some time.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 6, 2018

And the issue still occurs because the official windows binary is still based on python 3.4 which doesn't get new releases anymore or for quite some time.

It's wrong. This issue is unrelated to the Python version you're using. It's caused by a broken system configuration. Check out #7309 (comment)

@jaimehrubiks
Copy link

@jaimehrubiks jaimehrubiks commented Feb 6, 2018

I ended up disabling ssl by default on my application.

@wiiaboo
Copy link
Contributor

@wiiaboo wiiaboo commented Feb 6, 2018

Well, I've never seen anyone complain about this with 3.6+ whereas all issues I've seen came from people using the official binary, so I guess everyone's certs are broken except when using up-to-date python.

@sebbu2
Copy link

@sebbu2 sebbu2 commented Mar 28, 2018

I have the same issue after updating to 2018.03.26.1 (on windows 1709 x64 and python 3.4.4) using youtube-dl.exe (official windows binary) -U
Removing the expired certs in certmgr.msc is a no-go, i need thoses for hangouts to work (yes hangouts connect to some google subdomain who still uses expired certs).

@Hrxn
Copy link

@Hrxn Hrxn commented Mar 28, 2018

They use expired certs? Maybe someone should report that to Google instead?

@BlackHoleSpain
Copy link

@BlackHoleSpain BlackHoleSpain commented Mar 28, 2018

@sebbu2
Copy link

@sebbu2 sebbu2 commented Sep 9, 2018

hangouts needs thoses expired root/CA to work without warnings.
the site i'm trying to download from (youtube.com) with youtube-dl don't use expired certificates, but still warns because of the other, unrelated cetificates

@Hrxn
Copy link

@Hrxn Hrxn commented Sep 9, 2018

They use expired certs? Maybe someone should report that to Google instead?

@negativecitizen
Copy link

@negativecitizen negativecitizen commented Aug 29, 2020

I' ve a definitive solution FOR ME to this .You can redirect the download directory for youtube-dl to avoid this error :1. first locate your "settings.json" usually in "C:\Users<your user>\AppData\Roaming\youtube-dlg" 2. edit the last line ("youtubedl_path".............. ")
and change the path to something practical like C:\youtube-dl 3. paste the latest youtube-dl.exe downloaded from this url https://github.com/ytdl-org/youtube-dl/releases/
Probably you need to make the copy a a fresh .exe time to time to get the latest version but its straight and works.
This is a way to manually update the library avoiding the certificate error and the lost of time .Enjoy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.