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

certificate verify failed #15165

Closed
victornpb opened this issue Jan 4, 2018 · 8 comments
Closed

certificate verify failed #15165

victornpb opened this issue Jan 4, 2018 · 8 comments

Comments

@victornpb
Copy link

@victornpb victornpb commented Jan 4, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.12.31. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.12.31

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

$ youtube-dl -v  https://www.youtube.com/watch?v=Js3WIRF595U
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=Js3WIRF595U']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.12.31
[debug] Python version 2.7.13 - Darwin-16.0.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] Js3WIRF595U: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)'),))
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 517, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2198, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 1088, in https_open
    req, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1198, in do_open
    raise URLError(err)

Description of your issue, suggested solution and other information

I just freshly installed homebrew by issuing

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

and then installed youtube dl

brew install youtube-dl

running youtube-dl -v https://www.youtube.com/watch?v=Js3WIRF595U

it gave me the CERTIFICATE_VERIFY_FAILED error, so I did brew uninstall youtube-dl an tried installing it via curl

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

Same thing, I found 2 other closed issues related to reinstalling SSL, I tried that, but it still doesnt work.

$ openssl version
OpenSSL 1.0.2k  26 Jan 2017

I'm running macOS Sierra 10.12

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 4, 2018

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py

This is not a standard Homebrew Python path. Could you check if you have other package managers installed? (MacPorts, Fink, ...)

@ytdl-org ytdl-org deleted a comment Jan 4, 2018
@milleniumbug
Copy link

@milleniumbug milleniumbug commented Jan 6, 2018

I can reproduce the certificate verification failure issue on Windows 10 (youtube-dl installed through Chocolatey)

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.youtube.com/watch?v=Js3WIRF595U']
[debug] Encodings: locale cp1250, fs mbcs, out cp852, pref cp1250
[debug] youtube-dl version 2017.12.31
[debug] Python version 3.4.4 - Windows-10-10.0.16299
[debug] exe versions: ffmpeg 3.4.1, ffprobe 3.4.1
[debug] Proxy map: {}
[youtube] Js3WIRF595U: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)> (caused by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)'),))
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpiyv5xz5s\build\youtube_dl\extractor\common.py", line 517, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpiyv5xz5s\build\youtube_dl\YoutubeDL.py", line 2198, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 464, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 482, in _open
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpiyv5xz5s\build\youtube_dl\utils.py", line 1088, in https_open
  File "C:\Python\Python34\lib\urllib\request.py", line 1185, in do_open
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 6, 2018

@milleniumbug: How SSL works on Windows is different. Check #7309 (comment)

As there are no more responses from the original poster, I'm closing this issue.

@yan12125 yan12125 closed this Jan 6, 2018
@jschwalbe
Copy link

@jschwalbe jschwalbe commented Mar 13, 2018

@yan12125 Can I reopen it? I'm still having a similar problem (if not the same). macOS, installed via pip3.

$ youtube-dl --version
2018.03.10
$ youtube-dl -v https://www.fox.com/watch/a10a2d933255f29b6928c1dd0dbe9347
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.fox.com/watch/a10a2d933255f29b6928c1dd0dbe9347']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.10
[debug] Python version 3.6.0 (CPython) - Darwin-16.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.3.3, ffprobe 3.3.3, rtmpdump 2.4
[debug] Proxy map: {}
[FOX] a10a2d933255f29b6928c1dd0dbe9347: Downloading JSON metadata
ERROR: Unable to download JSON metadata: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)> (caused by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)'),))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/youtube_dl/extractor/common.py", line 519, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2199, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/youtube_dl/utils.py", line 1101, in https_open
    req, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
    raise URLError(err)
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 13, 2018

@jschwalbe: Most likely you are bitten by a Mac issue. Check out #11943 (comment)

@jschwalbe
Copy link

@jschwalbe jschwalbe commented Mar 17, 2018

Thanks @yan12125.
Since SSL isn't important to me, I've just updated my script to use the workaround:
--no-check-certificate Suppress HTTPS certificate validation

@ezerbib
Copy link

@ezerbib ezerbib commented May 29, 2019

For me it was the date of the device which was set later than the certificate expiration date. So double check the date of the device you run youtube-dl

@dezza
Copy link

@dezza dezza commented Jan 18, 2020

Make sure you have
pip install certifi
Installs Mozilla CA-bundle, apparently it's not included with Python3 installations. But it fixed a similar issue for me.

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
6 participants
You can’t perform that action at this time.