Skip to content

Fix SURFboard connection reset on old SB8200 firmware#308

Merged
itsDNNS merged 1 commit intomainfrom
fix/surfboard-connection-reset
Apr 2, 2026
Merged

Fix SURFboard connection reset on old SB8200 firmware#308
itsDNNS merged 1 commit intomainfrom
fix/surfboard-connection-reset

Conversation

@itsDNNS
Copy link
Copy Markdown
Owner

@itsDNNS itsDNNS commented Apr 2, 2026

Summary

  • Adds Connection: close header to all HNAP requests, preventing the modem's embedded web server from tearing down keep-alive connections before the response body is fully transmitted
  • Handles ConnectionError in get_docsis_data() with session reset and re-authentication, so mid-poll transport failures recover gracefully instead of aborting the poll cycle
  • Includes legacy TLS fallback for SB8200 firmware that only supports TLS 1.0/1.1 with ciphers rejected by OpenSSL 3.x

The full fallback chain is: normal HTTPS -> legacy TLS HTTPS -> HTTP.

Context

SB8200 modems on older firmware (e.g. AB01.02.053.05_051921) exhibit a pattern where the HNAP POST returns HTTP 200 headers, but the modem resets the TCP connection (ConnectionResetError 104) before the response body can be read. This happens consistently on every retry when using persistent HTTP/1.1 connections.

Test plan

Refs: #184

@itsDNNS itsDNNS force-pushed the fix/surfboard-connection-reset branch 4 times, most recently from 434bc24 to d760bc1 Compare April 2, 2026 06:25
SB8200 modems on older firmware reset the TCP connection after sending
HTTP 200 headers but before the response body is fully readable. This
is caused by the modem's embedded web server tearing down keep-alive
connections prematurely.

Changes:
- Send Connection: close on all HNAP requests unconditionally, not just
  during legacy TLS. This prevents the modem from attempting keep-alive
  and ensures the response is fully transmitted before socket teardown.
- Handle ConnectionError in get_docsis_data() with session reset and
  re-authentication, so mid-poll transport failures recover gracefully
  instead of aborting the entire poll cycle.

Refs: #184
@itsDNNS itsDNNS force-pushed the fix/surfboard-connection-reset branch from d760bc1 to e7994f5 Compare April 2, 2026 06:34
@itsDNNS itsDNNS merged commit de53371 into main Apr 2, 2026
8 checks passed
@itsDNNS itsDNNS deleted the fix/surfboard-connection-reset branch April 2, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant