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

youtube-dl -U fails on Android (SSL failure) #4864

Closed
bubbleguuum opened this issue Feb 4, 2015 · 8 comments
Closed

youtube-dl -U fails on Android (SSL failure) #4864

bubbleguuum opened this issue Feb 4, 2015 · 8 comments
Labels

Comments

@bubbleguuum
Copy link

@bubbleguuum bubbleguuum commented Feb 4, 2015

Since version 2015.01.09, updating the binary doesn't work anymore on Android (trace below). The cause seems to be commit aa2fd59 from Jan 9th.
It worked perfectly in versions prior 2015.01.09.
It would be great to have a command line option to use http instead of https for all update operations.

root@mako:/redacted/path/bin # ./python ./youtube-dl -Uv
on ./youtube-dl -Uv <
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-Uv']
[debug] Encodings: locale utf-8, fs utf-8, out utf-8, pref utf-8
[debug] youtube-dl version 2015.02.03.1
[debug] Python version 3.2.2 - Linux-3.4.0-faux123-mako-custom-kk44-armv7l-with-libc
[debug] exe versions: none
[debug] Proxy map: {}
Updating to version 2015.02.04 ...
Traceback (most recent call last):
File "/redacted/path/lib/python3.2/urllib/request.py", line 1136, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/redacted/path/lib/python3.2/http/client.py", line 964, in request
self._send_request(method, url, body, headers)
File "/redacted/path/lib/python3.2/http/client.py", line 1002, in _send_request
self.endheaders(body)
File "/redacted/path/lib/python3.2/http/client.py", line 960, in endheaders
self._send_output(message_body)
File "/redacted/path/lib/python3.2/http/client.py", line 805, in _send_output
self.send(msg)
File "/redacted/path/lib/python3.2/http/client.py", line 743, in send
self.connect()
File "/redacted/path/lib/python3.2/http/client.py", line 1105, in connect
server_hostname=server_hostname)
File "/redacted/path/lib/python3.2/ssl.py", line 181, in wrap_socket
_context=self)
File "/redacted/path/lib/python3.2/ssl.py", line 268, in init
raise x
File "/redacted/path/lib/python3.2/ssl.py", line 264, in init
self.do_handshake()
File "/redacted/path/lib/python3.2/ssl.py", line 443, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [Errno 1] _ssl.c:392: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./youtube-dl/youtube_dl/update.py", line 173, in update_self
urlh = opener.open(version['bin'][0])
File "/redacted/path/lib/python3.2/urllib/request.py", line 369, in open
response = self._open(req, data)
File "/redacted/path/lib/python3.2/urllib/request.py", line 387, in _open
'_open', req)
File "/redacted/path/lib/python3.2/urllib/request.py", line 347, in _call_chain
result = func(_args)
File "./youtube-dl/youtube_dl/utils.py", line 665, in https_open
req, *_kwargs)
File "/redacted/path/lib/python3.2/urllib/request.py", line 1139, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 1] _ssl.c:392: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed>

ERROR: unable to download latest version

@riking
Copy link
Contributor

@riking riking commented Feb 9, 2015

Who is the network provider?

It would be great to have a command line option to use http instead of https for all update operations.

I think that HTTPS is needed for the initial version check to prevent replay attacks.

@bubbleguuum
Copy link
Author

@bubbleguuum bubbleguuum commented Feb 9, 2015

What do you mean by network provider ?

@riking
Copy link
Contributor

@riking riking commented Feb 10, 2015

I mean like AT&T, Verizon, 3 (UK), Orange (France).

@bubbleguuum
Copy link
Author

@bubbleguuum bubbleguuum commented Feb 10, 2015

It's not a mobile network connection. Just a regular home WiFi connection to the Internet.
Again, it was caused by the changes from the Jan 9th commit I linked to.
Although it would be nice to have this fixed, I workarounded this issue downloading youtube-dl updates by other means.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 10, 2015

I am not sure what you mean by "caused". Yes, you would not encounter an error if we were to revert that change, but still something is seriously wrong with either the ISP or the certification infrastructure.

@bubbleguuum
Copy link
Author

@bubbleguuum bubbleguuum commented Feb 10, 2015

By "caused" I mean that it worked fine prior this commit and it doesn't work anymore after this commit (I checked it).
Now, it is not impossible that something is broken regarding TLS support in my python Android version.
It wouldn't be the first time that Python behaves oddly on Android (although in most cases it works just fine).

@natemara
Copy link

@natemara natemara commented Sep 28, 2015

I am also having the same issue under qpython3 on Android.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Dec 24, 2016

Works fine for me. Indeed SSL on Android is tricky. For future occurrences, ask qpython3 team or whatever party that provides Python on Android for why their SSL is broken.

shell@ASUS_Z00E_2:/data/local/tmp $ python3.7m youtube-dl -U -v              
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-U', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.12.01
[debug] Python version 3.7.0a0 - Linux-3.10.49-perf-gffc47ef-00061-g8a18133-aarch64-with-libc
[debug] exe versions: none
[debug] Proxy map: {}
Updating to version 2016.12.22 ...
Updated youtube-dl. Restart youtube-dl to use the new version.
shell@ASUS_Z00E_2:/data/local/tmp $ python3.7m youtube-dl -U -v                
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-U', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.12.22
[debug] Python version 3.7.0a0 - Linux-3.10.49-perf-gffc47ef-00061-g8a18133-aarch64-with-libc
[debug] exe versions: none
[debug] Proxy map: {}
youtube-dl is up-to-date (2016.12.22)
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
5 participants
You can’t perform that action at this time.