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

Soundcloud and HTTPS Don't Work #6708

Closed
thomasrussellmurphy opened this issue Aug 29, 2015 · 3 comments
Closed

Soundcloud and HTTPS Don't Work #6708

thomasrussellmurphy opened this issue Aug 29, 2015 · 3 comments

Comments

@thomasrussellmurphy
Copy link

@thomasrussellmurphy thomasrussellmurphy commented Aug 29, 2015

Verification of SSL certificate fails and youtube-dl cannot download metadata required for downloading from Soundcloud.

Updated to version 2015.08.28 (latest).

$ youtube-dl -v https://soundcloud.com/hardwithstyle/hard-with-style-episode-49
[debug] System config: []
[debug] User config: [u'-f', u'best']
[debug] Command-line args: [u'-v', u'https://soundcloud.com/hardwithstyle/hard-with-style-episode-49']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.08.28
[debug] Python version 2.7.10 - Darwin-13.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 2.7.2, ffprobe 2.7.2
[debug] Proxy map: {}
[soundcloud] hardwithstyle/hard-with-style-episode-49: Resolving id
[soundcloud] hardwithstyle/hard-with-style-episode-49: Downloading info JSON
ERROR: Unable to download JSON metadata: <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 "/Users/thomasrussellmurphy/bin/youtube-dl/youtube_dl/extractor/common.py", line 326, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/Users/thomasrussellmurphy/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1860, 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 437, in open
    response = meth(req, response)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 469, in error
    result = self._call_chain(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 656, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/Users/thomasrussellmurphy/bin/youtube-dl/youtube_dl/utils.py", line 749, in https_open
    req, **kwargs)
  File "/opt/local/Library/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 Aug 29, 2015

Could you try to install wget and curl, run curl 'https://api.soundcloud.com/tracks/221272846.json?client_id=b45b1aa10f1ac2941910a7f0d10f8e28' and wget 'https://api.soundcloud.com/tracks/221272846.json?client_id=b45b1aa10f1ac2941910a7f0d10f8e28' and post the output?

I had this problem previously, but it was caused by openssl (wget also failed) and I think it got fixed at some point after reinstalling openssl with brew reinstall openssl.

@thomasrussellmurphy
Copy link
Author

@thomasrussellmurphy thomasrussellmurphy commented Aug 29, 2015

I updated openssl to the latest version on MacPorts. I get the following outputs:

$ curl 'https://api.soundcloud.com/tracks/221272846.json?client_id=b45b1aa10f1ac2941910a7f0d10f8e28'
curl: (60) SSL certificate problem: certificate has expired
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
$ wget 'https://api.soundcloud.com/tracks/221272846.json?client_id=b45b1aa10f1ac2941910a7f0d10f8e28'
--16:49:39--  https://api.soundcloud.com/tracks/221272846.json?client_id=b45b1aa10f1ac2941910a7f0d10f8e28
           => `221272846.json?client_id=b45b1aa10f1ac2941910a7f0d10f8e28'
Resolving api.soundcloud.com... 72.21.91.127
Connecting to api.soundcloud.com[72.21.91.127]:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4,144 [application/json]

100%[========================================================>] 4,144         13.40K/s             

16:49:42 (13.36 KB/s) - `221272846.json?client_id=b45b1aa10f1ac2941910a7f0d10f8e28' saved [4144/4144]
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Aug 29, 2015

Therefore it's a problem on openssl or the certificates, you should report it to macports.

@jaimeMF jaimeMF closed this Aug 29, 2015
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
2 participants
You can’t perform that action at this time.