Closed tomasz8w closed 3 years ago
Hi @tomasz8w, Can you still log in to eLicznik using website? It seems that you have exceeded maximum number of unsuccessful login attempts.
I can access eLicznik without any trouble..
Can you provide your setup specification? (versions of HA, Python and requests library)
Sure, HA: 0.94.4 Python3: 3.7.3rc1 requests: 2.21.0
I found a workaround described here. Changing DEFAULT@SECLEVEL=2 to 1 in /etc/ssl/openssl.cnf resolves the issue.
Hi Piotr, I dont have such setting in openssl.cnf :) Is there any other workaround available?
Kernel: 5.4.0-62-generic x86_64 bits: 64 Desktop: Cinnamon 4.8.6 Distro: Linux Mint 20.1 Ulyssa
A workaroud for a workaround -> https://askubuntu.com/questions/1233186/ubuntu-20-04-how-to-set-lower-ssl-security-level
Hi @PiotrMachowski
I think I have a solution:
from requests import adapters
import ssl
from urllib3 import poolmanager
class TLSAdapter(adapters.HTTPAdapter):
def init_poolmanager(self, connections, maxsize, block=False):
"""Create and initialize the urllib3 PoolManager."""
ctx = ssl.create_default_context()
ctx.set_ciphers("DEFAULT@SECLEVEL=1")
ctx.check_hostname = False
self.poolmanager = poolmanager.PoolManager(
num_pools=connections,
maxsize=maxsize,
block=block,
ssl_version=ssl.PROTOCOL_TLS,
ssl_context=ctx,
)
session = requests.session()
session.mount("https://", TLSAdapter())
If you want I can prepare pull request to fix this this?
PS In AI-Speaker project we have config_flow for this integration, now custom components can implement config_flow too.
If you want I can pull this back too?
Regards :wave:
Hi @araczkowski! Thanks for your investigation, I would really appreciate a pull request with these changes (especially config flow)
Config flow will be delivered as separate pull, this will be bigger change. In AIS we are using all the automation tools used in HA (black formatter, sorts etc..). That is why all the code in config_flow pull will look little different then your code. It will be up to you to keep this format in your repo or reformat it back to yours.
BTW Please consider to join AIS. I can offer you write access to our repo and free AIS DEV3 gate :) On our forum, if somebody really need some new functionality, he need to sponsor 50% of the developer work, AI-Speaker are offering to pay rest (next 50%). It is win-win deal.
Let me know if you are interested, and you have time for this, and if you will be able to maintain your codes in our repo. I can introduce you, then together we can transfer some of your integrations to our fork of HA Core and add configurations flow for them.
We admire you work :1st_place_medal: Have a good day.
This issue should be fixed since v2.0.0
Hi @PiotrMachowski , Thanks for this implementation. I was trying to make it working but unfortunately I stuck up with this error:
Any idea how to resolve it and make it work?