home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.67k stars 30.8k forks source link

Gogle Calendar ssl.SSLError: [SSL] internal error #35870

Closed flechaig closed 4 years ago

flechaig commented 4 years ago

The problem

Since I upgraded to Ubuntu Focal, the Google Calendar integration stopped working with a ssl.SSLError: [SSL] internal error.

Environment

Problem-relevant configuration.yaml

Traceback/Error logs

`020-05-20 20:31:15 ERROR (MainThread) [homeassistant.setup] Error during setup of component google
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/setup.py", line 174, in _async_setup_component
    result = await hass.async_add_executor_job(
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/google/__init__.py", line 212, in setup
    do_authentication(hass, config, conf)
  File "/usr/src/app/homeassistant/components/google/__init__.py", line 144, in do_authentication
    dev_flow = oauth.step1_get_device_and_user_codes()
  File "/usr/local/lib/python3.8/dist-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/oauth2client/client.py", line 1961, in step1_get_device_and_user_codes
    resp, content = transport.request(
  File "/usr/local/lib/python3.8/dist-packages/oauth2client/transport.py", line 280, in request
    return http_callable(uri, method=method, body=body, headers=headers,
  File "/usr/local/lib/python3.8/dist-packages/httplib2/__init__.py", line 1322, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/local/lib/python3.8/dist-packages/httplib2/__init__.py", line 1072, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/local/lib/python3.8/dist-packages/httplib2/__init__.py", line 995, in _conn_request
    conn.connect()
  File "/usr/lib/python3.8/http/client.py", line 1409, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL] internal error (_ssl.c:1108)

Additional information

Google Calendar Events cannot be replaced simply, so it is very annoying.

probot-home-assistant[bot] commented 4 years ago

google documentation google source (message by IssueLinks)

tylerterzigni commented 4 years ago

I am also experiencing this and have tried deleting the pickle file and still get the same errors.

tylerterzigni commented 4 years ago

The problem

Since I upgraded to Ubuntu Focal, the Google Calendar integration stopped working with a ssl.SSLError: [SSL] internal error.

Environment

* Home Assistant Core release with the issue: 0.110.0

* Last working Home Assistant Core release (if known): 0.107.0 (I think)

* Operating environment (Home Assistant/Supervised/Docker/venv): Docker based on Ubuntu Focal 20.04 (Python 3.8)

* Integration causing this issue: Google Calendar in the OAuth2 library cannot establish the SSL connection to Google servers

* Link to integration documentation on our website: https://www.home-assistant.io/integrations/calendar.google/

Problem-relevant configuration.yaml

Traceback/Error logs

`020-05-20 20:31:15 ERROR (MainThread) [homeassistant.setup] Error during setup of component google
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/setup.py", line 174, in _async_setup_component
    result = await hass.async_add_executor_job(
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/google/__init__.py", line 212, in setup
    do_authentication(hass, config, conf)
  File "/usr/src/app/homeassistant/components/google/__init__.py", line 144, in do_authentication
    dev_flow = oauth.step1_get_device_and_user_codes()
  File "/usr/local/lib/python3.8/dist-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/oauth2client/client.py", line 1961, in step1_get_device_and_user_codes
    resp, content = transport.request(
  File "/usr/local/lib/python3.8/dist-packages/oauth2client/transport.py", line 280, in request
    return http_callable(uri, method=method, body=body, headers=headers,
  File "/usr/local/lib/python3.8/dist-packages/httplib2/__init__.py", line 1322, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/local/lib/python3.8/dist-packages/httplib2/__init__.py", line 1072, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/local/lib/python3.8/dist-packages/httplib2/__init__.py", line 995, in _conn_request
    conn.connect()
  File "/usr/lib/python3.8/http/client.py", line 1409, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL] internal error (_ssl.c:1108)

Additional information

Google Calendar Events cannot be replaced simply, so it is very annoying.

Did you happen to find a fix for this?

flechaig commented 4 years ago

No, I can't find any workaround. I tried updating all the Python components to the latest version, but the issue is still there.

philborman commented 4 years ago

I came across this issue trying to get info for a lazylibrarian issue with the same ssl error. The lazylibrarian fix is to downgrade openssl and libssl1.1 to the versions shipped with ubuntu 19.10. You can download from https://packages.ubuntu.com/eoan/openssl and https://packages.ubuntu.com/eoan/libssl1.1 Not sure exactly what's going on but something is broken in their library.

tylerterzigni commented 4 years ago

I cannot seem to find good detail on the proper commands to execute this if possible can you provide the commands you used to download/downgrade these packages?

philborman commented 4 years ago

Download the correct files for your architecture from the links provided, then install from a terminal with dpkg -i /path/to/file.deb

flechaig commented 4 years ago

Thank you @philborman, it worked straight away.

gelkin commented 4 years ago

Thank you @philborman saved my day!

surakin commented 4 years ago

Why was this closed? Downgrading a system library is not exactly a fix. This is happening again in Ubuntu Groovy btw.

cgtobi commented 4 years ago

@surakin while this is true it is not exactly within the scope of home assistant.

nogardvfx commented 4 years ago

Does anyone happen to have updated links to downgrade packages? The ones above are no longer available. Cheers.

philborman commented 4 years ago

https://launchpad.net/ubuntu/eoan/amd64/libssl1.1/1.1.1c-1ubuntu4.1

https://launchpad.net/ubuntu/eoan/amd64/openssl/1.1.1c-1ubuntu4.1

nogardvfx commented 4 years ago

Awesome thank you!

Axionkt commented 4 years ago

Same thing happened on Debian after openssl-1.1.1h-1 update. The following configuration can fix in in the meantime: https://bugs.python.org/msg376705

cgtobi commented 4 years ago

@Axionkt Great, thanks for sharing.