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

ERROR: unable to download video data: <urlopen error [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:1076)> #22665

Closed
shirishag75 opened this issue Oct 9, 2019 · 20 comments

Comments

@shirishag75
Copy link

@shirishag75 shirishag75 commented Oct 9, 2019

On quite a few different sites, I get the following error -

ERROR: unable to download video data: <urlopen error [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:1076)>
Traceback (most recent call last):
  File "/usr/lib/python3.7/urllib/request.py", line 1317, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/lib/python3.7/http/client.py", line 1422, in connect
    server_hostname=server_hostname)
  File "/usr/lib/python3.7/ssl.py", line 423, in wrap_socket
    session=session
  File "/usr/lib/python3.7/ssl.py", line 870, in _create
    self.do_handshake()
  File "/usr/lib/python3.7/ssl.py", line 1139, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:1076)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 1925, in process_info
    success = dl(filename, info_dict)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 1864, in dl
    return fd.download(name, info)
  File "/usr/lib/python3/dist-packages/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/lib/python3/dist-packages/youtube_dl/downloader/http.py", line 341, in real_download
    establish_connection()
  File "/usr/lib/python3/dist-packages/youtube_dl/downloader/http.py", line 109, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 2237, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.7/urllib/request.py", line 543, in _open
    '_open', req)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3/dist-packages/youtube_dl/utils.py", line 2724, in https_open
    req, **kwargs)
  File "/usr/lib/python3.7/urllib/request.py", line 1319, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:1076)>

And this is when we have -

Package: youtube-dl
Version: 2019.09.28-1
Severity: normal



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'testing-debug'), (100, 'unstable-debug'), (100, 'experimental'), (100, 'unstable'), (50, 'experimental-debug')
Architecture: amd64 (x86_64)

Kernel: Linux 5.2.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IN, LC_CTYPE=en_IN (charmap=UTF-8), LANGUAGE=en_IN:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages youtube-dl depends on:
ii  python3                3.7.5-1
ii  python3-pkg-resources  41.2.0-1

Versions of packages youtube-dl recommends:
ii  ca-certificates  20190110
ii  curl             7.66.0-1
ii  ffmpeg           7:4.1.4-1+b2
ii  mpv              0.29.1-1
ii  phantomjs        2.1.1+dfsg-2+b1
ii  python3-pyxattr  0.6.1-1
ii  rtmpdump         2.4+20151223.gitfa8646d.1-2
ii  wget             1.20.3-1+b1

youtube-dl suggests no packages.

-- no debconf information
@shirishag75 shirishag75 added the question label Oct 9, 2019
@dstftw dstftw closed this Oct 9, 2019
@dstftw dstftw added the incomplete label Oct 9, 2019
@tananga
Copy link

@tananga tananga commented Oct 12, 2019

Whats the status of this issue ? I have the same problem.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 12, 2019

@kamilPyrkosz97 They have closed it. I did send an e-mail to @dstftw but he hasn't got back to me as of yet. So don't think it will get fixed any time soonish :(

@tananga
Copy link

@tananga tananga commented Oct 13, 2019

@shirishag75 Maybe it's already fixed. I ready some similar issues and they said that in the next release it will work. Let's see.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 15, 2019

@kamilPyrkosz97 @dstftw made a new release today, were you able to test it out and see if your query is resolved. If so, please let me know then will test it at my end too.

The only commit I have seen so far is 7815d6b and from the looks of it, doesn't seem to be anything great in the release.

@tananga
Copy link

@tananga tananga commented Oct 15, 2019

Which command are you using in terminal ???

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 15, 2019

Which command are you using in terminal ???

for what to update youtube-dl ? If you are asking for that, I usually use the instructions given at https://github.com/ytdl-org/youtube-dl/blob/master/README.md#installation which are -

sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

and then when I want to do a new update then -
sudo youtube-dl -U

and after it gets updated, just check with

$ youtube-dl --version

If you are asking for what I use for downloading a video file, it's usually -
$ youtube-dl -c -f $formatID $VIDEOID

$formatID could be 22 18 or any of the hls streams depending on what is exposed via

youtube-dl -F $VIDEOID

sometimes I do use torsocks -i youtube-dl -c -f and the above command.

Let me know what you are/were asking about.

@tananga
Copy link

@tananga tananga commented Oct 15, 2019

Im was asking about downloading command. Im running this inside docker. How about you ? And Im downloading udemy videos. Im still testing. Im gonna tell you if I succeded.

@tananga
Copy link

@tananga tananga commented Oct 15, 2019

So far It's working !!!

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 15, 2019

After your go-ahead updated at my end too, I download it in debian (no docker needed/used) and it is downloading videos without issues. Thank you @dstftw

@tananga
Copy link

@tananga tananga commented Oct 15, 2019

Wait now I have the same issue

@tananga
Copy link

@tananga tananga commented Oct 15, 2019

After downloading something like 10 video I have unable to download video data: <urlopen error [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:1076)>

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 15, 2019

I am hoping, guessing you are using the --verbose switch ? Are you also using torsocks, or without that ?

@tananga
Copy link

@tananga tananga commented Oct 16, 2019

No Im just putting youtube-dl -u someemail@wp.pl -p simpletest123 -o '/containerUdemy/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/javascriptfundamentals/ in terminal.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 16, 2019

These are things at my end -

Package: youtube-dl
Version: 2019.09.28-1
Severity: normal

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'testing-debug'), (100, 'unstable-debug'), (100, 'experimental'), (100, 'unstable'), (50, 'experimental-debug')
Architecture: amd64 (x86_64)

Kernel: Linux 5.2.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IN, LC_CTYPE=en_IN (charmap=UTF-8), LANGUAGE=en_IN:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages youtube-dl depends on:
ii  python3                3.7.5-1
ii  python3-pkg-resources  41.2.0-1

Versions of packages youtube-dl recommends:
ii  ca-certificates  20190110
ii  curl             7.66.0-1
ii  ffmpeg           7:4.1.4-1+b2
ii  mpv              0.29.1-1
ii  phantomjs        2.1.1+dfsg-2+b1
ii  python3-pyxattr  0.6.1-1
ii  rtmpdump         2.4+20151223.gitfa8646d.1-2
ii  wget             1.20.3-1+b1

youtube-dl suggests no packages.

-- no debconf information

Only difference seems to be you are using a slightly older version of python3, the rest I don't know. I used reportbug to generate the versions of various dependencies.

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Oct 16, 2019

@kamilPyrkosz97 I was thinking about your issue today, one thing which might perhaps might help you is using strace. See https://unix.stackexchange.com/questions/293090/strace-syscall-classes . You would have to talk to @dstftw or somebody else to narrow down which syscalls to do and see. It is also possible that there may be either corruption or some race condition which is not being detected. But doing all of that is draining and time-consuming. I dunno how much you are interested in digging deep, but that's all I can offer atm :)

@tananga
Copy link

@tananga tananga commented Oct 17, 2019

I solved it. I just turn wifi off an on again and it works. After few minutes issue show once again but im again turn off and on wifi and I works !!!

@shirishag75
Copy link
Author

@shirishag75 shirishag75 commented Nov 14, 2019

that didn't work at my end. At my end at some videos, it just refuses to work :(

@beren12
Copy link

@beren12 beren12 commented Nov 29, 2019

I am hitting this on nickjr.com sometimes. I'm just using the latest youtube-dl and wrapping it in a while true loop. It eventually works.

@edelmoral
Copy link

@edelmoral edelmoral commented Jan 4, 2020

This isn't a direct issue of youtube-dl, this is related to openssl version 1.1.1 hardening the security of your system... in fact, the interoperability bug is on the server side (appears to be a wrong TLS 1.2 implementation). I don't know why this isn't overcome with the --no-check-certificate parameter, but if you're using Debian 10 (no idea where is located in other distros), just open your /etc/ssl/openssl.cnf , go to the last line and change:

CipherString = DEFAULT@SECLEVEL=2

to:

CipherString = DEFAULT@SECLEVEL=1

Bear in mind that you are making your system less secure with this workaround, so use it with caution

Further reading:
https://wiki.debian.org/ContinuousIntegration/TriagingTips/openssl-1.1.1
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907015
https://community.home-assistant.io/t/debian-10-and-openssl-1-1-1b-wrong-signature-type-errors/121050
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912759

@teraStars
Copy link

@teraStars teraStars commented Feb 1, 2020

This isn't a direct issue of youtube-dl, this is related to openssl version 1.1.1 hardening the security of your system... in fact, the interoperability bug is on the server side (appears to be a wrong TLS 1.2 implementation). I don't know why this isn't overcome with the --no-check-certificate parameter, but if you're using Debian 10 (no idea where is located in other distros), just open your /etc/ssl/openssl.cnf , go to the last line and change:

CipherString = DEFAULT@SECLEVEL=2

to:

CipherString = DEFAULT@SECLEVEL=1

Bear in mind that you are making your system less secure with this workaround, so use it with caution

Further reading:
https://wiki.debian.org/ContinuousIntegration/TriagingTips/openssl-1.1.1
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907015
https://community.home-assistant.io/t/debian-10-and-openssl-1-1-1b-wrong-signature-type-errors/121050
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912759

Thanks,you are right.

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.