-
Notifications
You must be signed in to change notification settings - Fork 17
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
Issue with public key #31
Comments
Hi @ATNALDC I tried to replicate your error but failed. In my unit tests and also my own system at home the login is working as expected. Does the error still persist? Also, could you check that your version of |
Hi @jgriss, I have no yet try to install last version again. I hope to be able to do it this wekeen. I will let you know. Thank you very much, |
Hi @jgriss Sorry for the delay. I've already install the last version but I get the same error: `Failed to load public key. During handling of the above exception, another exception occurred: Traceback (most recent call last): |
Hi again, I finally found, and solve the error. I don't know if it could be realted too python version because I've python3.9 and in another system that I used to test it with python3.12 it worked fine. In python 3.9 system the issue was with the code in line 53 of encryption.py file
Python considers that you are setting backend variable with another variable called default_backend but defacult_backend is insted a function. So you have to add parenthesis to solve it. The final code should be:
Thanks |
After updating to version 0.0.26 I haven't been able to loggin. I get the following error:
`Failed to load public key.
'function' object has no attribute 'load_pem_public_key'
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/fusion_solar_py/encryption.py", line 53, in encrypt_password
public_key = serialization.load_pem_public_key(
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/serialization/base.py", line 23, in load_pem_public_key
return backend.load_pem_public_key(data)
AttributeError: 'function' object has no attribute 'load_pem_public_key'
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/fusion_solar_py/encryption.py", line 53, in encrypt_password
public_key = serialization.load_pem_public_key(
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/serialization/base.py", line 23, in load_pem_public_key
return backend.load_pem_public_key(data)
AttributeError: 'function' object has no attribute 'load_pem_public_key'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/etc/openhab/scripts/huawei_test_basic.py", line 4, in
client = FusionSolarClient("XXXXX", "XXXXXX")
File "/home/pi/.local/lib/python3.9/site-packages/fusion_solar_py/client.py", line 238, in init
self._configure_session()
File "/home/pi/.local/lib/python3.9/site-packages/fusion_solar_py/client.py", line 387, in _configure_session
self._login()
File "/home/pi/.local/lib/python3.9/site-packages/fusion_solar_py/client.py", line 169, in wrapper
result = func(self, *args, **kwargs)
File "/home/pi/.local/lib/python3.9/site-packages/fusion_solar_py/client.py", line 327, in _login
password = encrypt_password(key_data=key_data, password=password)
File "/home/pi/.local/lib/python3.9/site-packages/fusion_solar_py/encryption.py", line 60, in encrypt_password
raise FusionSolarException("Failed to load public key for encryption.")
fusion_solar_py.exceptions.FusionSolarException: Failed to load public key for encryption.
`
Do you know what it could be happening?
Thank you very much,
Kind regards,
The text was updated successfully, but these errors were encountered: