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 Error #5668

Closed
carloabelli opened this issue May 10, 2015 · 7 comments
Closed

SSL: CERTIFICATE_VERIFY_FAILED Error #5668

carloabelli opened this issue May 10, 2015 · 7 comments

Comments

@carloabelli
Copy link

@carloabelli carloabelli commented May 10, 2015

Attempting to use on soundcloud.com results in:

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

Similar issue for youtube.com:

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

Using version 2015.05.10 with Python 2.7.9.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 10, 2015

Post the full output you get when running with --verbose option.

@carloabelli
Copy link
Author

@carloabelli carloabelli commented May 10, 2015

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=XXXXXX', u'--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.05.10
[debug] Python version 2.7.9 - Darwin-14.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.6.2, ffprobe 2.6.2
[debug] Proxy map: {}
[youtube] XXXXXX: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)> (caused by URLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),))
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 312, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1710, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 713, in https_open
    req, **kwargs)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 10, 2015

That's not an issue with youtube-dl, it's caused by the openssl installed with Homebrew. Try with the solutions listed in these comments: #5317 (comment) and #5317 (comment).

@jaimeMF jaimeMF closed this May 10, 2015
@stewartadam
Copy link

@stewartadam stewartadam commented May 16, 2015

I'm getting the same problem, neither adding the Equifax certificate manually to /usr/local/openssl/etc/certs (and rehashing the certs) or reinstalling OpenSSL has helped.

openssl: stable 1.0.2a-1 (bottled)
youtube-dl: stable 2015.05.15 (bottled)
OS X Yosemite 10.10.3

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 16, 2015

@stewartadam what happens if you install wget with Homebrew and run wget 'https://youtube.com/watch?v=<SOME_VIDEO_ID>'?

@stewartadam
Copy link

@stewartadam stewartadam commented May 17, 2015

Interesting, I had Homebrew's wget installed already but did a reinstall just in case.

YouTube now works fine (both from wget and youtube-dl) however SoundCloud still fails:

$ wget https://soundcloud.com
--2015-05-17 13:27:36--  https://soundcloud.com/
Resolving soundcloud.com... 72.21.91.127
Connecting to soundcloud.com|72.21.91.127|:443... connected.
ERROR: cannot verify soundcloud.com's certificate, issued by 'CN=GlobalSign Domain Validation CA - SHA256 - G2,O=GlobalSign nv-sa,C=BE':
  Issued certificate has expired.
To connect to soundcloud.com insecurely, use `--no-check-certificate'.
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 17, 2015

I also get the same for soundcloud, but it works with Safari and Firefox. As I said this is not a problem in youtube-dl (as you can see, it also fails with wget), but with the openssl provided by Homebrew.

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