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 _ssl.c: 720 #12348

Closed
Celthi opened this issue Mar 4, 2017 · 13 comments
Closed

certificate verify failed _ssl.c: 720 #12348

Celthi opened this issue Mar 4, 2017 · 13 comments

Comments

@Celthi
Copy link
Contributor

@Celthi Celthi commented Mar 4, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.03.02. 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.03.02

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably 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 -v flag to your command line you run youtube-dl with, 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 --proxy 127.0.0.1:8087 https://www.youtube.com/watch?v=iKDtmV5xSv0 -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--proxy', '127.0.0.1:8087', 'https://www.youtube.com/watch?v=iKDtmV5xSv0', '-v']
[debug] Encodings: locale cp936, fs mbcs, out cp936, pref cp936
[debug] youtube-dl version 2017.03.02
[debug] Python version 3.5.3 - Windows-10-10.0.10240-SP0
[debug] exe versions: none
[debug] Proxy map: {'http': '127.0.0.1:8087', 'https': '127.0.0.1:8087'}
[youtube] iKDtmV5xSv0: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)> (caused by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)'),))
  File "c:\users\celhipc\python35\lib\site-packages\youtube_dl\extractor\common.py", line 496, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "c:\users\celhipc\python35\lib\site-packages\youtube_dl\YoutubeDL.py", line 2093, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "c:\users\celhipc\python35\lib\urllib\request.py", line 466, in open
    response = self._open(req, data)
  File "c:\users\celhipc\python35\lib\urllib\request.py", line 484, in _open
    '_open', req)
  File "c:\users\celhipc\python35\lib\urllib\request.py", line 444, in _call_chain
    result = func(*args)
  File "c:\users\celhipc\python35\lib\site-packages\youtube_dl\utils.py", line 1083, in https_open
    req, **kwargs)
  File "c:\users\celhipc\python35\lib\urllib\request.py", line 1256, in do_open
    raise URLError(err)
...
<end of log>


Description of your issue, suggested solution and other information

running youtube-dl in win 10 and the python version is 3.5.3. I have searched many issue about certificate very failed, and try the comment1 and other methods, but they don't work. And I notice the verify failed number is verify failed (_ssl.c:720), is different from what have posted, like 600, 581 and more. I have use google to search the exact number on the issues, and found none.

if add the flag --no-check-certificate, it will work.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 4, 2017

I guess you're using XX-net or other GAE (Google App Engine) based proxies? If so --no-check-certificate is the only solution.

@Celthi
Copy link
Contributor Author

@Celthi Celthi commented Mar 4, 2017

yeach, I'm using GAE as proxy, but it worked well before. I dont remember the exact version, since I upgrade, I got the problem. Is there a way to roll back a lower version of youtube-dl

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 4, 2017

it worked well before

That's interesting. Maybe you were using some older Python versions before? Certificate verification wasn't enabled until Python 2.7.9.

@Celthi
Copy link
Contributor Author

@Celthi Celthi commented Mar 4, 2017

Yeah, it is the python 2.7.9

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 4, 2017

Do you mean 2.7.9 works but 3.5.3 fails? I might be inaccurate. I meant, In Python 2.x, up to 2.7.8, doesn't verify certificates, so there won't be errors. Since 2.7.9, it would work the same as all 3.x versions.

@Celthi
Copy link
Contributor Author

@Celthi Celthi commented Mar 5, 2017

I don't remember the exact version, but definitely is either 2.7.9 or 3.4. Because my computer only have these two version python when youtube-dl worked fine.

And in March 3, 3rd, I installed 3.6 version, and then 3.5 versioned, and in these two version I use pip install youtube-dl to install youtube-dl, then the verify certificate failed problem came out.

I try different solutions, the problem keep switch from ssl.c 600 to ssl.c 720. Note, I try to solve ssl.c 600 use comment, and didn't work.

When was certificates verification added to youtube-dl? Is it always there? My environment is completed messy.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 5, 2017

When was certificates verification added to youtube-dl?

Yes it's always there. The verification is performed by the underlying Python, not youtube-dl.

Could you paste verbose logs of youtube-dl -v "some video URL" both both a working and a broken version?

@Celthi
Copy link
Contributor Author

@Celthi Celthi commented Mar 5, 2017

I have updated all the youtube-dl to the version 2017.3.02, so now they all not working. And the working case related to a older version of youtube-dl. Is there a link to download the old version youtube-dl, so I could try to reproduce the working logs.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 5, 2017

In https://rg3.github.io/youtube-dl/update/versions.json, there are URLs of versions since 2012.02.22. Please tell me if you need even older versions.

@Celthi
Copy link
Contributor Author

@Celthi Celthi commented Mar 5, 2017

This is fair enough. Now I will try to reproduce it.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 5, 2017

Well, lots of URLs in versions.json are dead. Specificially, files uploaded before #9690 are not moved to Github, so they'll end up with 404.

Files on https://pypi.org/project/youtube_dl/#history are still fine. As you're already using pip, you can install old versions with ==. For example:

pip install youtube_dl==2013.01.17.1 --user
@Celthi
Copy link
Contributor Author

@Celthi Celthi commented Mar 5, 2017

I have try many version of youtube-dl, but the problem cant reproduce. And I switch different proxy the problem is gone. SO the problem is the the proxy I'm using(There must something changed, but I can't roll all the things back). And the problem is beyond the scope of youtube-dl, So I just use no-check-certificate. Very appreciate your help.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Mar 5, 2017

OK. I'll closing it first as apparently it's not directly related to youtube-dl. Feel free to post your new findings if any.

@yan12125 yan12125 closed this Mar 5, 2017
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.