Skip to content

fix: sing-box "unsafe" fingerprint guard and CipherSuites resets (follow-up to #1) - #2

Merged
patterniha merged 1 commit into
masterfrom
fix/cipher-suites-unsafe-followup
Jul 10, 2026
Merged

fix: sing-box "unsafe" fingerprint guard and CipherSuites resets (follow-up to #1)#2
patterniha merged 1 commit into
masterfrom
fix/cipher-suites-unsafe-followup

Conversation

@patterniha

Copy link
Copy Markdown
Owner

Follow-up to #1, which added the cipherSuites TLS option and the unsafe fingerprint. That PR was largely complete (all 8 locales, both WPF and Avalonia layouts, DB column auto-migrates via sqlite-net), but an audit found two behavioral gaps.

What changed

  • sing-box unsafe fingerprint guard (SingboxOutboundService.cs): unsafe is an Xray-only fingerprint. sing-box passes the node fingerprint into tls.utls.fingerprint and rejects unknown uTLS names at startup, so any node with fingerprint unsafe running on the sing-box core failed to connect. Also reachable indirectly: AddServerCommon stamps the global default fingerprint (settable to unsafe in the options window) onto REALITY nodes with an empty fingerprint. uTLS is now skipped when the fingerprint is unsafe — plain Go TLS is also what Xray's unsafe semantically means, so behavior converges across cores.
  • CipherSuites resets for Hysteria2/Naive (ConfigHandler.cs): feat: add cipherSuites option and "unsafe" fingerprint to TLS UI settings #1 disabled txtCipherSuites for these protocols but their add/save paths only reset Fingerprint/Alpn, leaving stale CipherSuites values in the database. The reset is added alongside the existing ones.

Considered and deliberately not changed

  • CompareProfileItem doesn't compare CipherSuites: the function consistently excludes manual-only fields (EchConfigList, VerifyPeerCertByName, Cert) and also drives active-node re-selection and traffic-stats preservation across subscription updates, where new items can never carry cipherSuites. Adding it would break re-matching of manually edited subscription items.
  • TUIC/Anytls keep txtCipherSuites enabled despite being sing-box-only — matches existing precedent (verifyPeerCertByName, also Xray-only, stays enabled for them).
  • unsafe + REALITY on Xray: the shared fingerprint combos offer unsafe for REALITY where Xray may reject it; validation is left to the core.

ServiceLib builds cleanly with these changes (0 warnings, 0 errors).

🤖 Generated with Claude Code

…low-up to #1)

The "unsafe" fingerprint added in #1 is Xray-only: sing-box passes the
node fingerprint into tls.utls.fingerprint and rejects unknown uTLS
names at startup, so any node with fingerprint "unsafe" running on the
sing-box core failed to connect. This is also reachable indirectly via
AddServerCommon, which stamps the global default fingerprint (settable
to "unsafe" in options) onto REALITY nodes. Skip uTLS in that case;
plain Go TLS matches what Xray's "unsafe" means anyway.

Also reset CipherSuites in AddHysteria2Server and AddNaiveServer
alongside the existing Fingerprint/Alpn resets, since #1 disabled the
textbox for these protocols but left stale values in the database.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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