fix(ftp): cap H2C FTPS to TLS 1.2 so the sliced 3MF downloads reliably (#2582)

H2C (firmware 01.02.00.00) had no per-model FTP profile and ran on the
Python-default TLS 1.3, hitting the same vsFTPd session-reuse fault the P2S
(#1401) and X2D (#1638) were already capped for. The intermittent FTPS
failure dropped prints to the no-3MF fallback archive, so slice data was
missing — hence no filament in the Print Log and no inventory deduction.
Add an H2C cap_tls_v1_2 profile plus its O1C/O1C2 SSDP aliases. H2D is left
on the default profile (negotiates TLS 1.3 without the fault).
This commit is contained in:
maziggy
2026-07-18 09:33:22 +02:00
parent cc75a24371
commit 9174badb10
3 changed files with 32 additions and 0 deletions
@@ -58,6 +58,22 @@ def test_x2d_internal_ssdp_code_resolves_to_x2d():
assert profile.cap_tls_v1_2 is True
def test_h2c_caps_tls_v1_2():
"""H2C firmware 01.02.00.00 — same H2 generation / firmware line as
P2S — intermittently fails the FTPS 3MF download and falls through to
the no-3MF fallback archive, so nothing gets deducted (#2582, reporter
@gyrene2083). The profile caps to TLS 1.2 by analogy with P2S."""
profile = get_ftp_profile("H2C")
assert profile.cap_tls_v1_2 is True
def test_h2c_internal_ssdp_codes_resolve_to_h2c():
"""SSDP internal codes O1C and O1C2 (dual-nozzle variant) → H2C
profile, so the cap applies however the model string arrives."""
assert get_ftp_profile("O1C").cap_tls_v1_2 is True
assert get_ftp_profile("O1C2").cap_tls_v1_2 is True
def test_lookup_is_case_insensitive():
"""Printer.model may carry mixed case; the lookup normalises."""
assert get_ftp_profile("p2s").cap_tls_v1_2 is True