You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support IPPS printers that only offer older TLS cipher suites - #195628
IPP printers that only offer old TLS cipher suites can't be set up over IPPS, and the form only says "Failed to connect".
The Fuji Xerox DocuPrint CM315Z in #194928 offers only TLS_RSA_WITH_AES_{128,256}_CBC_SHA{,256} (RSA key exchange, no forward secrecy), and no newer firmware exists. Python's default client context offers none of these, so the printer ends every handshake with a handshake_failure alert. aioipp turned that into a plain IPPConnectionError, and the config flow showed the generic cannot_connect.
This PR:
Falls back to older cipher suites only when a printer needs them. The config flow (user, zeroconf and reconfigure) connects with the default context first. Only when the printer rejects the handshake, and "Verify SSL certificate" is off, does it retry with SSLCipherList.INTERMEDIATE (Mozilla's intermediate v4 profile, with SSL_ALPN_HTTP11 like the shared HTTP client). If that works, it stores legacy_tls: true on the entry (and on an existing entry for the same printer, if its stored port, path, SSL and verify settings match the endpoint that was checked), and the coordinator uses the intermediate profile only for such entries. Every other printer, including all existing entries, keeps the default context, so a printer that supports ECDHE but prefers static RSA isn't moved onto a suite without forward secrecy. The fallback is skipped with certificate verification on: there, a forged handshake failure from an on-path attacker could otherwise make the flow store the weaker profile, whereas without verification such an attacker could intercept the connection anyway. With verification on, a legacy-only printer gets tls_unsupported_verify_ssl, which explains that it can be set up with verification turned off. The intermediate profile still lists ECDHE suites first and does not include SSLCipherList.INSECURE. The contexts are the cached ones homeassistant.util.ssl creates at import, so nothing blocks the event loop.
Explains why a TLS handshake failed. aioipp now raises IPPConnectionTLSError (a subclass of IPPConnectionError) with OpenSSL's reason. The config flow maps the reason to a translated error: tls_unsupported (no common TLS version or cipher suite), tls_not_offered (the port doesn't speak TLS), tls_certificate (verification failed, e.g. a self-signed certificate), or tls_error otherwise. The user and reconfigure steps show it on the form, and the zeroconf step aborts with it. The raw OpenSSL reason is logged at debug level.
Bumps aioipp to 0.22.0, which provides both of the above.
Verified with OpenSSL 3.5 against an HTTPS IPP server limited to the printer's four suites over TLS 1.2. The default context fails with SSLV3_ALERT_HANDSHAKE_FAILURE. The intermediate context negotiates AES128-SHA and parses the printer attributes, which is the path the fallback takes.
The rest are dependency and CI updates. Runtime requirements are unchanged.
The version bump and the integration change go together: the integration uses IPPConnectionTLSError and the ssl_context argument, which first ship in aioipp 0.22.0.
Type of change
Dependency upgrade
Bugfix (non-breaking change which fixes an issue)
New integration (thank you!)
New feature (which adds functionality to an existing integration)
Deprecation (breaking change to happen in the future)
Breaking change (fix/feature causing existing functionality to break)
Code quality improvements to existing code or addition of tests (refactoring, typing, performance, etc.)
Developer tooling (CI, GitHub workflows, linters and checkers, scripts, AI instructions, code owners)
This is your PR dashboard which flags anything you need to address before your PR can be reviewed. Once everything is green, you can press the 'Ready for review' button at the bottom of the page to notify reviewers to take a look.
More information about this dashboard
This dashboard automatically updates on every change to this PR and reevaluates the rules as you go. Until everything has been addressed, the bot will keep the PR in draft.
Skip a check that doesn't apply
If you think a check doesn't apply to your PR (or the rule is bugged), comment @home-assistant ignore "<check name>" "<reason>". The check name as shown in the table above. This will mark the check as ignored and let you put your PR in 'Ready for review'; @home-assistant unignore "<check name>" restores the rule.
Bot commands
Reply with @home-assistant <command>. Several commands can be stacked, one per line:
update — Re-runs the bot's checks on the issue or pull request.
ignore — Waives a dashboard check: ignore "<check name>" "<reason>". (author) — e.g. @home-assistant ignore "Merge conflicts" "Broken rule, no merge conflicts present"
unignore — Restores a waived dashboard check: unignore "<check name>". (author) — e.g. @home-assistant unignore "Merge conflicts"
unassign — Removes the given integration domain's label and its code owners from the assignees. (author or code owners) — e.g. @home-assistant unassign "opensky"
close — Closes the issue or pull request. (code owners)
reopen — Reopens the issue or pull request. (code owners)
rename — Renames the issue or pull request: rename "<new title>". (code owners) — e.g. @home-assistant rename "A more descriptive title"
add-label — Adds a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the issue or pull request. (code owners) — e.g. @home-assistant add-label "needs-more-information"
remove-label — Removes a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) from the issue or pull request. (code owners) — e.g. @home-assistant remove-label "needs-more-information"
mark-draft — Marks the pull request as draft. (code owners)
update-branch — Updates the pull request branch with the base branch. (code owners)
Checks
✨ Everything's in order!
6 checks passed (7 skipped)
Status
Check
Details
✅
Forbidden files
No forbidden files.
✅
Merge conflicts
Merge status is being recalculated by GitHub.
✅
Merge target
This PR targets dev.
✅
Type of change
Type of change: bugfix
✅
PR title
The title is clear.
✅
CLA
Everyone involved has signed the CLA.
➖
New integration validation
Not a new-integration PR.
➖
New platform validation
No new platforms added.
➖
Config flow tests
No new config flows added.
➖
Documentation
Not a new integration or platform — no documentation PR required.
➖
Belongs together
No pull requests listed.
➖
Code owner approval
Touches no platinum integration — no code-owner approval required.
➖
Blocking: awaiting-frontend
awaiting-frontend label not set — nothing to block.
Hey there @ctalkington, mind taking a look at this pull request as it has been labeled with an integration (ipp) you are listed as a code owner for? Thanks!
Code owner commands
Reply with @home-assistant <command>:
update — Re-runs the bot's checks on the issue or pull request.
ignore — Waives a dashboard check: ignore "<check name>" "<reason>". (author) — e.g. @home-assistant ignore "Merge conflicts" "Broken rule, no merge conflicts present"
unignore — Restores a waived dashboard check: unignore "<check name>". (author) — e.g. @home-assistant unignore "Merge conflicts"
unassign — Removes the given integration domain's label and its code owners from the assignees. (author or code owners) — e.g. @home-assistant unassign "opensky"
close — Closes the issue or pull request. (code owners)
reopen — Reopens the issue or pull request. (code owners)
rename — Renames the issue or pull request: rename "<new title>". (code owners) — e.g. @home-assistant rename "A more descriptive title"
add-label — Adds a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the issue or pull request. (code owners) — e.g. @home-assistant add-label "needs-more-information"
remove-label — Removes a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) from the issue or pull request. (code owners) — e.g. @home-assistant remove-label "needs-more-information"
mark-draft — Marks the pull request as draft. (code owners)
update-branch — Updates the pull request branch with the base branch. (code owners)
Map OpenSSL's reason to tls_unsupported, tls_not_offered or
tls_certificate (tls_error otherwise) instead of showing the raw code,
and log the code at debug level. Use SSL_ALPN_HTTP11 like the shared
HTTP client. Config flow tests now finish the flow after an error and
assert the unique ID.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The TLS changes can silently weaken cipher security for already-compatible printers, while shared error messages can misdiagnose handshake failures and give discovery users instructions they cannot follow.
Keep the existing cipher policy for printers that can already connect, and offer the legacy suites only when needed. A TLS 1.2 server can select its own preferred cipher regardless of the client ordering, so a printer supporting both ECDHE and static RSA may now choose RSA and lose forward secrecy even though it previously negotiated ECDHE. A default-first connection or explicit legacy opt-in would avoid silently weakening those connections.
Zeroconf aborts can't show the connection form, so only the form errors
tell the user what to change. A handshake_failure alert can also come
from SNI or client-certificate requirements, so describe a version or
cipher mismatch as likely rather than certain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Enabling legacy RSA ciphers by default can remove forward secrecy from existing IPPS connections when printers prefer static RSA, so compatibility should remain opt-in or follow an attempt with the default profile.
Avoid enabling legacy RSA ciphers in the default TLS profile
homeassistant/components/ipp/coordinator.py:44
Keep legacy RSA ciphers opt-in or try the default profile before falling back to this one. TLS 1.2 servers can choose their own cipher order, so a printer that supports ECDHE but prefers AES128-SHA will negotiate static RSA without forward secrecy despite its lower position in the client list. This can affect existing IPPS setups, not just printers requiring the compatibility fallback.
A TLS 1.2 printer may choose its own cipher order, so offering the
intermediate profile to every printer could move one that supports
ECDHE but prefers static RSA onto a suite without forward secrecy.
Connect with the default context first. Only when the printer rejects
the handshake, retry with the intermediate profile and record
legacy_tls on the entry; the coordinator uses the intermediate profile
only for those entries. Existing entries keep the default context.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re Copilot's point about offering the older suites to every printer: addressed in 73faf8f. The config flow now connects with the default context first and only retries with the intermediate profile when the printer rejects the handshake. It records legacy_tls on the entry, and the coordinator only uses the intermediate profile for those entries, so existing setups keep the default context.
When the user or zeroconf step finds a configured printer that now
needs the older cipher suites, set legacy_tls along with the new host.
The flag is only ever turned on, which is safe: it is ignored without
TLS and the intermediate profile still prefers ECDHE. Expected
connection attempts in the TLS error tests are now a parameter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With verification on, a forged handshake failure from an on-path
attacker could make the flow store the weaker profile for a printer
that supports ECDHE. Without verification such an attacker could
intercept the connection anyway, so the fallback gives nothing away.
With verification on, a legacy-only printer now gets an error that
explains it can be set up with verification turned off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Legacy ciphers can be enabled by attacker-triggered handshake alerts or applied to a different stored endpoint, potentially removing forward secrecy through static RSA.
The duplicate-entry paths keep the stored port, path, TLS and
verification settings, so only set the flag when those match the
endpoint that needed the fallback. Otherwise the entry is left as it
was apart from the host, and the user can reconfigure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Protocol-version errors incorrectly trigger cipher-fallback behavior and misleading advice to disable certificate verification, while legacy-TLS reconfiguration lacks success and verification-blocked test coverage.
The intermediate profile does not allow older TLS versions, so only
cipher-related handshake failures are retried with it or answered with
the advice to turn verification off. Version errors keep the
tls_unsupported message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The TLS handling misclassifies INSUFFICIENT_SECURITY as a legacy-cipher issue, potentially prompting disabled certificate verification or weaker ciphers when the server requires stronger security.
That alert means the printer wants stronger suites, so neither the
retry nor the advice to turn verification off can help. It keeps the
tls_unsupported message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
IPP printers that only offer old TLS cipher suites can't be set up over IPPS, and the form only says "Failed to connect".
The Fuji Xerox DocuPrint CM315Z in #194928 offers only
TLS_RSA_WITH_AES_{128,256}_CBC_SHA{,256}(RSA key exchange, no forward secrecy), and no newer firmware exists. Python's default client context offers none of these, so the printer ends every handshake with ahandshake_failurealert. aioipp turned that into a plainIPPConnectionError, and the config flow showed the genericcannot_connect.This PR:
SSLCipherList.INTERMEDIATE(Mozilla's intermediate v4 profile, withSSL_ALPN_HTTP11like the shared HTTP client). If that works, it storeslegacy_tls: trueon the entry (and on an existing entry for the same printer, if its stored port, path, SSL and verify settings match the endpoint that was checked), and the coordinator uses the intermediate profile only for such entries. Every other printer, including all existing entries, keeps the default context, so a printer that supports ECDHE but prefers static RSA isn't moved onto a suite without forward secrecy. The fallback is skipped with certificate verification on: there, a forged handshake failure from an on-path attacker could otherwise make the flow store the weaker profile, whereas without verification such an attacker could intercept the connection anyway. With verification on, a legacy-only printer getstls_unsupported_verify_ssl, which explains that it can be set up with verification turned off. The intermediate profile still lists ECDHE suites first and does not includeSSLCipherList.INSECURE. The contexts are the cached oneshomeassistant.util.sslcreates at import, so nothing blocks the event loop.IPPConnectionTLSError(a subclass ofIPPConnectionError) with OpenSSL's reason. The config flow maps the reason to a translated error:tls_unsupported(no common TLS version or cipher suite),tls_not_offered(the port doesn't speak TLS),tls_certificate(verification failed, e.g. a self-signed certificate), ortls_errorotherwise. The user and reconfigure steps show it on the form, and the zeroconf step aborts with it. The raw OpenSSL reason is logged at debug level.Verified with OpenSSL 3.5 against an HTTPS IPP server limited to the printer's four suites over TLS 1.2. The default context fails with
SSLV3_ALERT_HANDSHAKE_FAILURE. The intermediate context negotiatesAES128-SHAand parses the printer attributes, which is the path the fallback takes.Library changes 0.21.2 → 0.22.0: brianegge/aioipp@0.21.2...0.22.0
Release notes: https://github.com/brianegge/aioipp/releases/tag/0.22.0
The version bump and the integration change go together: the integration uses
IPPConnectionTLSErrorand thessl_contextargument, which first ship in aioipp 0.22.0.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests:
🤖 Generated with Claude Code