python-hpilo icon indicating copy to clipboard operation
python-hpilo copied to clipboard

python-hpilo can't connect anymore to an iLO2 server on python3.10

Open accessiblepixel opened this issue 3 years ago • 0 comments

Hello.

I use Home Assistant with the python-hpilo functionality to monitor some old servers in a dashboard.

From what I have read, the supported versions of TLS have had the defaults changed to not allow anything "worse" than TLS1.2, so the old versions of SSLv3 that iLO2 uses doesn't work anymore in python 3.10

I tried changing some options in hpilo.py to enable SSLv3 but haven't been successful thus far and I am unsure how to proceed.

Home Assistant has recently bumped its python version to 3.10 and downgrading to an older version isn't really an option, because even if I did downgrade, it would only be a stop gap solution.

I'm not sure how to proceed and I've tried as much as I can to figure out the problem by myself.

A potential workaround I could see is running a proxy webserver to sit between the two to "upgrade" it's TLS version, but I'm not sure.

I would appreciate any help that you can provide.

Kind regards, Jessica

Here are the attached parts of the log that might be useful

` Logger: homeassistant.components.sensor Source: components/hp_ilo/sensor.py:166 Integration: Sensor (documentation, issues) First occurred: 06:22:44 (4 occurrences) Last logged: 06:22:45 hp_ilo: Error on device update!

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/hpilo.py", line 401, in _get_socket return ssl.wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLS) File "/usr/local/lib/python3.10/ssl.py", line 1442, in wrap_socket return context.wrap_socket( File "/usr/local/lib/python3.10/ssl.py", line 513, in wrap_socket return self.sslsocket_class._create( File "/usr/local/lib/python3.10/ssl.py", line 1071, in _create self.do_handshake() File "/usr/local/lib/python3.10/ssl.py", line 1342, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 446, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 702, in async_device_update await task File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/hp_ilo/sensor.py", line 166, in update ilo_data = getattr(self.hp_ilo_data.data, self._ilo_function)() File "/usr/local/lib/python3.10/site-packages/hpilo.py", line 1035, in get_embedded_health return self._info_tag('SERVER_INFO', 'GET_EMBEDDED_HEALTH', 'GET_EMBEDDED_HEALTH_DATA', File "/usr/local/lib/python3.10/site-packages/hpilo.py", line 730, in _info_tag header, message = self._request(root) File "/usr/local/lib/python3.10/site-packages/hpilo.py", line 238, in _request self._detect_protocol() File "/usr/local/lib/python3.10/site-packages/hpilo.py", line 278, in _detect_protocol header, data = self._communicate(b'<RIBCL VERSION="2.0"></RIBCL>', ILO_HTTP, save=False) File "/usr/local/lib/python3.10/site-packages/hpilo.py", line 406, in _communicate sock = self._get_socket() File "/usr/local/lib/python3.10/site-packages/hpilo.py", line 403, in _get_socket raise IloCommunicationError("Cannot establish ssl session with %s:%d: %s" % (self.hostname, self.port, str(exc))) hpilo.IloCommunicationError: Cannot establish ssl session with ilo2.local.dns:443: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997) `

accessiblepixel avatar Jul 09 '22 05:07 accessiblepixel