SSL error #7338

Closed
opened 2026-02-21 02:35:38 -05:00 by deekerman · 21 comments
Owner

Originally created by @thany on GitHub (Mar 24, 2016).

Just downloaded a fresh copy 5 minutes ago, tried it with a simple command like this:

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

And there ya go:

[youtube] NK6B6WjHC68: 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)'),))

That's on Windows 10. All my browsers can open the url perfectly fine without warnings or anything.

Originally created by @thany on GitHub (Mar 24, 2016). Just downloaded a fresh copy 5 minutes ago, tried it with a simple command like this: ``` youtube-dl https://www.youtube.com/watch?v=NK6B6WjHC68 ``` And there ya go: ``` [youtube] NK6B6WjHC68: 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)'),)) ``` That's on Windows 10. All my browsers can open the url perfectly fine without warnings or anything.
deekerman 2026-02-21 02:35:38 -05:00
Author
Owner

@yan12125 commented on GitHub (Mar 24, 2016):

Possibly duplicate of #7309. Could you try the solution at https://github.com/rg3/youtube-dl/issues/7309#issuecomment-167414048?

@yan12125 commented on GitHub (Mar 24, 2016): Possibly duplicate of #7309. Could you try the solution at https://github.com/rg3/youtube-dl/issues/7309#issuecomment-167414048?
Author
Owner

@thany commented on GitHub (Mar 24, 2016):

Tried to no avail. In my cert store, I don't have any Google/Youtube-related certs at all...

@thany commented on GitHub (Mar 24, 2016): Tried to no avail. In my cert store, I don't have any Google/Youtube-related certs at all...
Author
Owner

@yan12125 commented on GitHub (Mar 24, 2016):

Do you have a "GeoTrust Global CA" certificate?

@yan12125 commented on GitHub (Mar 24, 2016): Do you have a "GeoTrust Global CA" certificate?
Author
Owner

@thany commented on GitHub (Mar 24, 2016):

Two of them as well, and both expire somewhere in 2022.

@thany commented on GitHub (Mar 24, 2016): Two of them as well, and both expire somewhere in 2022.
Author
Owner

@yan12125 commented on GitHub (Mar 24, 2016):

There should be exactly one. Can you check that both have exactly the name "GeoTrust Global CA"?
And, is the start time of the valid interval of the certificate covers your current system time?

@yan12125 commented on GitHub (Mar 24, 2016): There should be exactly one. Can you check that both have exactly the name "GeoTrust Global CA"? And, is the start time of the valid interval of the certificate covers your current system time?
Author
Owner

@steve5777 commented on GitHub (Mar 24, 2016):

I also have this issue on Linux. New cert file, openssl 1.0.2g, python 2.7.11. I also tried the 2016.03.14 version of youtube-dl, same results. It seems to be a youtube-specific problem, as CBS (Platform) works fine.

@steve5777 commented on GitHub (Mar 24, 2016): I also have this issue on Linux. New cert file, openssl 1.0.2g, python 2.7.11. I also tried the 2016.03.14 version of youtube-dl, same results. It seems to be a youtube-specific problem, as CBS (Platform) works fine.
Author
Owner

@yan12125 commented on GitHub (Mar 24, 2016):

Forgot to ask. Did you use proxies? Post the verbose log with -v:

youtube-dl -v "https://www.youtube.com/watch?v=NK6B6WjHC68"

@steve5777 On Linux SSL certs handling is different from Windows. Please refer to #5225.

@yan12125 commented on GitHub (Mar 24, 2016): Forgot to ask. Did you use proxies? Post the verbose log with `-v`: ``` youtube-dl -v "https://www.youtube.com/watch?v=NK6B6WjHC68" ``` @steve5777 On Linux SSL certs handling is different from Windows. Please refer to #5225.
Author
Owner

@steve5777 commented on GitHub (Mar 24, 2016):

No, I didn't use a proxy. And here's the log. Hope it helps! BTW, with --no-check-certificate it does work fine.

[debug] System config: []
[debug] User config: [u'--continue', u'--restrict-filenames']
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=NK6B6WjHC68']
[debug] Encodings: locale ANSI_X3.4-1968, fs ANSI_X3.4-1968, out ANSI_X3.4-1968, pref ANSI_X3.4-1968
[debug] youtube-dl version 2016.03.18
[debug] Python version 2.7.11 - Linux-2.4.37-i686-with-slackware-7.1.0
[debug] exe versions: ffmpeg 2.0, rtmpdump 2.4
[debug] Proxy map: {}
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 "/usr/bin/youtube-dl/youtube_dl/extractor/common.py", line 365, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1929, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/usr/bin/youtube-dl/youtube_dl/utils.py", line 860, in https_open
req, *_kwargs)
File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)

@steve5777 commented on GitHub (Mar 24, 2016): No, I didn't use a proxy. And here's the log. Hope it helps! BTW, with --no-check-certificate it does work fine. [debug] System config: [] [debug] User config: [u'--continue', u'--restrict-filenames'] [debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=NK6B6WjHC68'] [debug] Encodings: locale ANSI_X3.4-1968, fs ANSI_X3.4-1968, out ANSI_X3.4-1968, pref ANSI_X3.4-1968 [debug] youtube-dl version 2016.03.18 [debug] Python version 2.7.11 - Linux-2.4.37-i686-with-slackware-7.1.0 [debug] exe versions: ffmpeg 2.0, rtmpdump 2.4 [debug] Proxy map: {} 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 "/usr/bin/youtube-dl/youtube_dl/extractor/common.py", line 365, in _request_webpage return self._downloader.urlopen(url_or_request) File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1929, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/usr/lib/python2.7/urllib2.py", line 431, in open response = self._open(req, data) File "/usr/lib/python2.7/urllib2.py", line 449, in _open '_open', req) File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain result = func(_args) File "/usr/bin/youtube-dl/youtube_dl/utils.py", line 860, in https_open req, *_kwargs) File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open raise URLError(err)
Author
Owner

@yan12125 commented on GitHub (Mar 24, 2016):

@steve5777 Please open a new issue. Don't mix Linux logs in an issue for Windows.

@yan12125 commented on GitHub (Mar 24, 2016): @steve5777 Please open a new issue. Don't mix Linux logs in an issue for Windows.
Author
Owner

@steve5777 commented on GitHub (Mar 31, 2016):

OK, sorry about that. In my case, the problem turned out to be a Python update. Apparently all versions since 2.7.9 try to verify certs by default. After much searching, it turns out all I needed to do was set the variable SSL_CERT_FILE to the correct location. No idea if this helps with Windows, though.

@steve5777 commented on GitHub (Mar 31, 2016): OK, sorry about that. In my case, the problem turned out to be a Python update. Apparently all versions since 2.7.9 try to verify certs by default. After much searching, it turns out all I needed to do was set the variable SSL_CERT_FILE to the correct location. No idea if this helps with Windows, though.
Author
Owner

@mikaiyl commented on GitHub (Mar 31, 2016):

inb4 update openssl and python https://github.com/Homebrew/homebrew/issues/38226

@mikaiyl commented on GitHub (Mar 31, 2016): inb4 update openssl and python https://github.com/Homebrew/homebrew/issues/38226
Author
Owner

@yan12125 commented on GitHub (Apr 1, 2016):

Don't discuss SSL issues on non-Windows systems in this thread anymore. I'm waiting for @thany's response for what's happening on his/her system. SSL things are quite different on Windows and other systems. Just don't mix them together.

@yan12125 commented on GitHub (Apr 1, 2016): Don't discuss SSL issues on non-Windows systems in this thread anymore. I'm waiting for @thany's response for what's happening on his/her system. SSL things are quite different on Windows and other systems. Just don't mix them together.
Author
Owner

@cc0ut commented on GitHub (Apr 1, 2016):

Same issue here on window 10 but not with youtube but soundclound

PS > .\youtube-dl.exe -v "https://soundcloud.com/hipsterslovecrazyantics/babymetal-07"
.\youtube-dl.exe : [debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'https://soundcloud.com/hipsterslovecrazyantics/babymetal-07']
[debug] Encodings: locale cp1252, fs mbcs, out None, pref cp1252
[debug] youtube-dl version 2016.03.27
[debug] Python version 2.7.10 - Windows-8-6.2.9200
[debug] exe versions: none
[debug] Proxy map: {}
[soundcloud] hipsterslovecrazyantics/babymetal-07: Resolving id
[soundcloud] hipsterslovecrazyantics/babymetal-07: 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 "youtube_dl\extractor\common.pyo", line 366, in _request_webpage
  File "youtube_dl\YoutubeDL.pyo", line 1934, in urlopen
  File "urllib2.pyo", line 437, in open
  File "urllib2.pyo", line 550, in http_response
  File "urllib2.pyo", line 469, in error
  File "urllib2.pyo", line 409, in _call_chain
  File "urllib2.pyo", line 656, in http_error_302
  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 864, in https_open
  File "urllib2.pyo", line 1197, in do_open
@cc0ut commented on GitHub (Apr 1, 2016): Same issue here on window 10 but not with youtube but soundclound ``` PS > .\youtube-dl.exe -v "https://soundcloud.com/hipsterslovecrazyantics/babymetal-07" .\youtube-dl.exe : [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'https://soundcloud.com/hipsterslovecrazyantics/babymetal-07'] [debug] Encodings: locale cp1252, fs mbcs, out None, pref cp1252 [debug] youtube-dl version 2016.03.27 [debug] Python version 2.7.10 - Windows-8-6.2.9200 [debug] exe versions: none [debug] Proxy map: {} [soundcloud] hipsterslovecrazyantics/babymetal-07: Resolving id [soundcloud] hipsterslovecrazyantics/babymetal-07: 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 "youtube_dl\extractor\common.pyo", line 366, in _request_webpage File "youtube_dl\YoutubeDL.pyo", line 1934, in urlopen File "urllib2.pyo", line 437, in open File "urllib2.pyo", line 550, in http_response File "urllib2.pyo", line 469, in error File "urllib2.pyo", line 409, in _call_chain File "urllib2.pyo", line 656, in http_error_302 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 864, in https_open File "urllib2.pyo", line 1197, in do_open ```
Author
Owner

@yan12125 commented on GitHub (Apr 1, 2016):

@cc0ut As another reporter said in https://github.com/rg3/youtube-dl/issues/9046#issuecomment-204344648: you need to visit https://soundcloud.com/ and https://api.soundcloud.com/ in Internet Explorer or Edge so that Windows will fetch the necessary certificates.
If things are still, check "GlobalSign Root CA" in certmgr.msc.

@yan12125 commented on GitHub (Apr 1, 2016): @cc0ut As another reporter said in https://github.com/rg3/youtube-dl/issues/9046#issuecomment-204344648: you need to visit https://soundcloud.com/ and https://api.soundcloud.com/ in Internet Explorer or Edge so that Windows will fetch the necessary certificates. If things are still, check "GlobalSign Root CA" in certmgr.msc.
Author
Owner

@cc0ut commented on GitHub (Apr 1, 2016):

That works.
Btw, I had no problem downloading video from youtube or vimeo despite never having opened the those sites in edge (only in firefox)

@cc0ut commented on GitHub (Apr 1, 2016): That works. Btw, I had no problem downloading video from youtube or vimeo despite never having opened the those sites in edge (only in firefox)
Author
Owner

@yan12125 commented on GitHub (Apr 1, 2016):

Two possibilities:

  • As Adam Goodman said in http://bugs.python.org/issue20916, Microsoft pre-installs some certificates. The one YouTube uses (GeoTrust Global CA) and the one Vimeo uses (DigiCert Global Root CA) may already be included.
  • A root CA issues certificates to many websites. Visiting any of them in IE/Edge brings necessary root CA certificates.

I believe @thany is also a victim of Microsoft's new policy. If anyone gets the same error, feel free to open a new issue or leave comments here.

@yan12125 commented on GitHub (Apr 1, 2016): Two possibilities: - As Adam Goodman said in http://bugs.python.org/issue20916, Microsoft pre-installs some certificates. The one YouTube uses (GeoTrust Global CA) and the one Vimeo uses (DigiCert Global Root CA) may already be included. - A root CA issues certificates to many websites. Visiting any of them in IE/Edge brings necessary root CA certificates. I believe @thany is also a victim of Microsoft's new policy. If anyone gets the same error, feel free to open a new issue or leave comments here.
Author
Owner

@kanonji commented on GitHub (Feb 20, 2017):

I have got the same error and solved by accessing youtube with IE11.

Error message

PS > youtube-dl.exe "http://www.youtube.com/watch?v=6brejYnhpuc" --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['http://www.youtube.com/watch?v=6brejYnhpuc', '--verbose']
[debug] Encodings: locale cp932, fs mbcs, out cp932, pref cp932
[debug] youtube-dl version 2017.02.16
[debug] Python version 3.4.4 - Windows-10-10.0.14393
[debug] exe versions: ffmpeg N-83507-g8fa18e0, ffprobe N-83507-g8fa18e0
[debug] Proxy map: {}
[youtube] 6brejYnhpuc: 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\tmpnd0pf5s_\build\youtube_dl\extractor\common.py", lin
e 416, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpnd0pf5s_\build\youtube_dl\YoutubeDL.py", line 2006,
 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\tmpnd0pf5s_\build\youtube_dl\utils.py", line 1060, in
https_open
  File "C:\Python\Python34\lib\urllib\request.py", line 1185, in do_open

What I did

  1. Access youtube with Edge.
  2. Try youtube-dl and get error again.
  3. Check GeoTrust Global CA that will be expired at 2022-05-21
  4. Access youtube with IE11
  5. Try youtube-dl and get worked.

Env

  • Windows10 Pro: 1607
  • youtube-dl: 2017.02.16
@kanonji commented on GitHub (Feb 20, 2017): I have got the same error and solved by accessing youtube with IE11. ## Error message ``` PS > youtube-dl.exe "http://www.youtube.com/watch?v=6brejYnhpuc" --verbose [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['http://www.youtube.com/watch?v=6brejYnhpuc', '--verbose'] [debug] Encodings: locale cp932, fs mbcs, out cp932, pref cp932 [debug] youtube-dl version 2017.02.16 [debug] Python version 3.4.4 - Windows-10-10.0.14393 [debug] exe versions: ffmpeg N-83507-g8fa18e0, ffprobe N-83507-g8fa18e0 [debug] Proxy map: {} [youtube] 6brejYnhpuc: 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\tmpnd0pf5s_\build\youtube_dl\extractor\common.py", lin e 416, in _request_webpage File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpnd0pf5s_\build\youtube_dl\YoutubeDL.py", line 2006, 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\tmpnd0pf5s_\build\youtube_dl\utils.py", line 1060, in https_open File "C:\Python\Python34\lib\urllib\request.py", line 1185, in do_open ``` ## What I did 1. Access youtube with Edge. 2. Try youtube-dl and get error again. 3. Check GeoTrust Global CA that will be expired at 2022-05-21 4. Access youtube with IE11 5. Try youtube-dl and get worked. ## Env * Windows10 Pro: 1607 * youtube-dl: 2017.02.16
Author
Owner

@thany commented on GitHub (Feb 24, 2017):

But such a thing shouldn't be necessary, right?

For instance, this cannot be done on a Server Core edition of Windows which doesn't have any GUI. Furthermore, IE11 is a deprecated browser - requiring that, even if only once, feels not right.

Lastly, it's a workaround that seemingly has nothing to do with the script. I mean, why would visiting the site with a deprecated browser magically fix this script? Makes no sense to me.

But good to know there's a workaround. Because that's really what it is :)

@thany commented on GitHub (Feb 24, 2017): But such a thing shouldn't be necessary, right? For instance, this cannot be done on a Server Core edition of Windows which doesn't have any GUI. Furthermore, IE11 is a deprecated browser - requiring that, even if only once, feels not right. Lastly, it's a workaround that seemingly has nothing to do with the script. I mean, why would visiting the site with a deprecated browser magically fix this script? Makes no sense to me. But good to know there's a workaround. Because that's really what it is :)
Author
Owner

@yan12125 commented on GitHub (Feb 24, 2017):

Here's a follow-up: a pending patch at http://bugs.python.org/issue28747 enables Python the ability to update system certificates, just like IE.

Makes no sense to me

Indeed. Another Microsoft software design with no sense.

@yan12125 commented on GitHub (Feb 24, 2017): Here's a follow-up: a pending patch at http://bugs.python.org/issue28747 enables Python the ability to update system certificates, just like IE. > Makes no sense to me Indeed. Another Microsoft software design with no sense.
Author
Owner

@thany commented on GitHub (Feb 24, 2017):

The workaround, accessing the site with IE11, doesn't work for me on at least one computer I got. Just tried with a freshly downloaded copy of youtube-dl, and on a fully up-to-date Windows 10. I've got Python 2.7.13 installed, does that matter?...

@thany commented on GitHub (Feb 24, 2017): The workaround, accessing the site with IE11, doesn't work for me on at least one computer I got. Just tried with a freshly downloaded copy of youtube-dl, and on a fully up-to-date Windows 10. I've got Python 2.7.13 installed, does that matter?...
Author
Owner

@yan12125 commented on GitHub (Feb 24, 2017):

Sorry I can't help you more. There are tons of reasons in SSL errors and most of them are beyond my imagination.

If you know how to build Python on Windows, my patch at http://bugs.python.org/issue28182 can give more information for SSL errors.

I've got Python 2.7.13 installed, does that matter?...

Theoretically, no

@yan12125 commented on GitHub (Feb 24, 2017): Sorry I can't help you more. There are tons of reasons in SSL errors and most of them are beyond my imagination. If you know how to build Python on Windows, my patch at http://bugs.python.org/issue28182 can give more information for SSL errors. > I've got Python 2.7.13 installed, does that matter?... _Theoretically_, no
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#7338
No description provided.