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

[BUG] Error retrieving login URL from ThinQ #133

Closed
lordraiden opened this issue Mar 15, 2021 · 12 comments
Closed

[BUG] Error retrieving login URL from ThinQ #133

lordraiden opened this issue Mar 15, 2021 · 12 comments

Comments

@lordraiden
Copy link

Describe the bug
1
imagen
2
imagen

Expected behavior
Go to the next step

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details:

  • Environment (HASSIO, Raspbian, etc): Docker
  • Home Assistant version installed: Home Assistant 2021.3.4
  • Component version installed: 0.6.1

Output of HA logs
Paste the relavant output of the HA log here.

Logger: custom_components.smartthinq_sensors
Source: custom_components/smartthinq_sensors/wideq/core_v2.py:129
Integration: SmartThinQ LGE Sensors (documentation)
First occurred: 10:25:56 PM (4 occurrences)
Last logged: 10:32:29 PM

Error retrieving login URL from ThinQ
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 392, in connect
    self.ssl_context = create_urllib3_context(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 283, in create_urllib3_context
    context.set_ciphers(ciphers or DEFAULT_CIPHERS)
ssl.SSLError: ('No cipher can be selected.',)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='route.lgthinq.com', port=46030): Max retries exceeded with url: /v1/service/application/gateway-uri (Caused by SSLError(SSLError('No cipher can be selected.')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/smartthinq_sensors/__init__.py", line 98, in getLoginUrl
    login_url = client.gateway.oauth_url()
  File "/config/custom_components/smartthinq_sensors/wideq/core_v2.py", line 600, in gateway
    self._gateway = Gateway.discover(self._country, self._language)
  File "/config/custom_components/smartthinq_sensors/wideq/core_v2.py", line 292, in discover
    gw = gateway_info(country, language)
  File "/config/custom_components/smartthinq_sensors/wideq/core_v2.py", line 206, in gateway_info
    return thinq2_get(V2_GATEWAY_URL, country=country, language=language)
  File "/config/custom_components/smartthinq_sensors/wideq/core_v2.py", line 129, in thinq2_get
    res = requests.get(
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='route.lgthinq.com', port=46030): Max retries exceeded with url: /v1/service/application/gateway-uri (Caused by SSLError(SSLError('No cipher can be selected.')))

Additional context
It was working before but I don't remeber the component version (2 or 3 weeks ago) then some day it stopped working
Then I uninstalled it and installed again to start from scrach now I get this error.

@ollo69
Copy link
Owner

ollo69 commented Mar 15, 2021

Did you install something in the machine that host HA? There is an SSL error ('No cipher can be selected.'), looks like the machine is not able to establish the SSL connection with LG server.

@lordraiden
Copy link
Author

Did you install something in the machine that host HA? There is an SSL error ('No cipher can be selected.'), looks like the machine is not able to establish the SSL connection with LG server.

It's the official docker image, so is not like I can install anything on it and I haven't done it anyway. Could you give me more clues of what could interfere with the SSL cipher selection?
I could do some troubleshoting but I have not idea where to start

@lordraiden
Copy link
Author

I have HACS with this integrations but nothing else
imagen

@inorhan
Copy link

inorhan commented Mar 15, 2021

Hello.

I have the exact same problem, also "Es" account location, and "ssl.SSLError: ('No cipher can be selected.',)".
Was working before too.

I see more errors like that one lately: https://community.home-assistant.io/t/get-roomba-blid-pw-the-easy-way-using-windows/75107/20

ProxmoxVE integration it's complaining too (same "ssl.SSLError: ('No cipher can be selected.')

Maybe a problem with Python-Hassio?

@ollo69
Copy link
Owner

ollo69 commented Mar 15, 2021

It could be. But did you update HASSIO recently?

@inorhan
Copy link

inorhan commented Mar 15, 2021

Yes, I have Home Assistant 2021.3.4, HACS updated too.

core-2021.3.4
Sistema operativo del Host | Home Assistant OS 5.12
Canal de actualización | stable
Versión del Supervisor | supervisor-2021.03.6
Versión de Docker | 19.03.13

I don't really know when started to fail...

@ollo69
Copy link
Owner

ollo69 commented Mar 16, 2021

This is quite complex, I don't really know how to help. I thing that there are some configuration than provide supported cipher, but I don't know exactly where to find this. I'm not using HASSIO. If I have some time I will make some test with it, but I don't know when it will happen.
I suggest you to google your issue, and please post here if you find a solution.

@stboch
Copy link

stboch commented Mar 29, 2021

@inorhan Try removing lines 115-125 of custom_components/smartthinq_sensors/wideq/core_v2.py #139

@inorhan
Copy link

inorhan commented Mar 30, 2021

@inorhan Try removing lines 115-125 of custom_components/smartthinq_sensors/wideq/core_v2.py #139

That worked perfectly, no more "ssl.SSLError: ('No cipher can be selected.',)". Thanks!!!

@ollo69
Copy link
Owner

ollo69 commented Mar 30, 2021

Really good to know, working on final fix

ollo69 added a commit that referenced this issue Mar 31, 2021
- Removed modification to SSL DEFAULT_CIPHERS (issue #139 & #133)
- Disabled by default SSL work-around
- Implemented new configuration options to enable SSL work-around
- Removed core_v2.py dependencies from core.py
- Removed old .translation directory
- Minor code review
@ollo69
Copy link
Owner

ollo69 commented Apr 2, 2021

Can we close this issue? It should be fixed with last release.

@ollo69
Copy link
Owner

ollo69 commented May 10, 2021

Close due to inactivity and because it should be fixed. Re-open if additional info available.

@ollo69 ollo69 closed this as completed May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants