Commit ce6be08
committed
fix: raise ISYConnectionError on SSL/TLS handshake failures
aiohttp.ClientConnectorSSLError is a subclass of ClientOSError, so the
existing catch-all branch silently classified TLS handshake failures as
generic "ISY not ready or closed connection." debug — leaving callers
with no signal to look at TLS settings and the retry path returning a
silent None that looks like a transient miss.
Catch ClientSSLError (covers both ClientConnectorSSLError and
ClientConnectorCertificateError) before the generic ClientOSError
branch and always raise ISYConnectionError with the SSL detail in the
exception message. The original aiohttp error rides along in the
``__cause__`` chain. No separate WARNING/ERROR log so the failure
surfaces exactly once.
Always raise (not just on retries=None) because an SSL handshake
failure isn't a transient network issue — it's a config mismatch
(controller pinned below the ``tls_ver='auto'`` floor of TLS 1.2, or
``verify_ssl=True`` against the controller's self-signed cert) that
won't recover from retry. Callers (HA Core) need a definitive failure
to translate into ConfigEntryNotReady, not silent retries.
Smoke-tested against an ISY-994 manually downgraded to TLS 1.1 with
``MinProtocol=TLSv1.2`` on the host: previously surfaced as the opaque
debug + a generic ISYConnectionError from test_connection's "Could not
connect" wrapper; now raises ``ISYConnectionError("SSL/TLS error:
... [SSL: UNSUPPORTED_PROTOCOL] ...")`` directly with the
ClientConnectorSSLError preserved in __cause__.1 parent 64349f1 commit ce6be08
2 files changed
Lines changed: 70 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
215 | 231 | | |
216 | 232 | | |
217 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
301 | 355 | | |
302 | 356 | | |
303 | 357 | | |
| |||
0 commit comments