xybu / onedrive-d-old

Microsoft OneDrive client on Linux.
http://xybu.me/projects/onedrive-d/
GNU Lesser General Public License v3.0
820 stars 143 forks source link

Network error when running onedrive-pref #182

Closed ghost closed 8 years ago

ghost commented 8 years ago

When running onedrive-pref, I paste the callback URL.

https://login.live.com/oauth20_desktop.srf?code=xxxxxxxx-xxxx-...

I'm only getting this

[2015-09-11 14:40:25,896] INFO: MainThread: network connection error.
[2015-09-11 14:40:25,896] INFO: MainThread: put to sleep due to networking error.
[2015-09-11 14:40:26,016] DEBUG: thread_mgr: able to realize "onedrive.com:80".
[2015-09-11 14:40:26,016] INFO: MainThread: waken up by ThreadManager.
[2015-09-11 14:40:26,375] INFO: MainThread: network connection error.
[2015-09-11 14:40:26,375] INFO: MainThread: put to sleep due to networking error.
[2015-09-11 14:40:26,506] DEBUG: thread_mgr: able to realize "onedrive.com:80".
[2015-09-11 14:40:26,507] INFO: MainThread: waken up by ThreadManager.

Using elementary OS 0.3 (Ubuntu 14.04)

ilMike42 commented 8 years ago

Same problem here, Ubuntu 14.04.3 LTS.

erinzm commented 8 years ago

Same problem as well, Ubuntu 15.04.

xybu commented 8 years ago

Something must have changed on OnrDrive's sign in flow.

Sincerely, Xiangyu Bu

Sent from my Windows Phone


From: Liam Marshallmailto:notifications@github.com Sent: ‎9/‎11/‎2015 5:13 PM To: xybu/onedrive-d-oldmailto:onedrive-d-old@noreply.github.com Subject: Re: [onedrive-d-old] Network error when running onedrive-pref (#182)

Same problem as well, Ubuntu 15.04.


Reply to this email directly or view it on GitHub: https://github.com/xybu/onedrive-d-old/issues/182#issuecomment-139662555

xybu commented 8 years ago

Are you guys behind some proxy? What is your internet connection? I can't reproduce the problem here.

erinzm commented 8 years ago

It seems to be a SSL error, when I ^c the process I get a bunch of exceptions of the form:

^CTraceback (most recent call last):
  File "/home/liam/.local/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
    body=body, headers=headers)
  File "/home/liam/.local/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 341, in _make_request
    self._validate_conn(conn)
  File "/home/liam/.local/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 761, in _validate_conn
    conn.connect()
  File "/home/liam/.local/lib/python3.4/site-packages/requests/packages/urllib3/connection.py", line 238, in connect
    ssl_version=resolved_ssl_version)
  File "/home/liam/.local/lib/python3.4/site-packages/requests/packages/urllib3/util/ssl_.py", line 279, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.4/ssl.py", line 365, in wrap_socket
    _context=self)
  File "/usr/lib/python3.4/ssl.py", line 583, in __init__
    self.do_handshake()
  File "/usr/lib/python3.4/ssl.py", line 810, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/liam/.local/lib/python3.4/site-packages/requests/adapters.py", line 370, in send
    timeout=timeout
  File "/home/liam/.local/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 574, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

During handling of the above exception, another exception occurred:
erinzm commented 8 years ago

Nope, not behind a proxy either. Just normal, Charter-cable internet.

ghost commented 8 years ago

Normal connection here too. Here's my error log http://pastebin.com/jYFyE81k

ilMike42 commented 8 years ago

Normal connection for me, too.

oSLXo commented 8 years ago

Same issue , Debian 8.2 x64 , no proxy Internet connexions tested : France ADSL SFR Operator & France 3G Mobile Bouygues Tel. Operator OneDrive with Two Factor authentification (just in case, but callback url is well return by onedrive website)

sleepyfran commented 8 years ago

Same issue here with Ubuntu 15.04 and no proxy.

xybu commented 8 years ago

It's more likely some issue on the server side. A possible workaround would be to disable SSL certification verification on python-requests package. It would be adding the argument everywhere requests is used in the API code.

oSLXo commented 8 years ago

Interactive request with browsers to http://onedrive.com are redirected to https://

In ondrive-pref log we see : thread_mgr: able to realize "onedrive.com:80". Shouldn't it try to connect onedrive.com:443 ?

Maybe Microsoft have made some change on the network load balancer / web application firewall going wrong with onedrive-pref ... something like user-agent not being correctly detected and not redirected to https://

ebrainte commented 8 years ago

I figured it out. Just go to line 185 of file od_onedrive_api.py and change OneDriveAPI.OAUTH_TOKEN_URI, data=params, verify=True)

to

OneDriveAPI.OAUTH_TOKEN_URI, data=params, verify=False)

Now build and install it. Voila!

erinzm commented 8 years ago

@ebrainte: This is the correct fix - for whatever reason, Kenneth Reitz's Certif.io doesn't verify Onedrive's HTTPS cert properly.

xybu commented 8 years ago

Documented the problem in https://github.com/xybu/onedrive-d/issues/19. Will port the workaround to new version when I get time.