fix(naive): stop sending unsupported alpn/insecure to sing-box naive outbound#46
Merged
Merged
Conversation
…outbound FlowZ built the naive outbound TLS with `alpn` and `insecure`, but sing-box's naive outbound (Cronet manages its own TLS) supports only server_name/certificate/certificate_path/ech and hard-fails at startup if either is set: FATAL: initialize outbound: alpn is not supported on naive outbound FATAL: initialize outbound: insecure is not supported on naive outbound So a naive node with a custom ALPN, or with "allow insecure" enabled, made sing-box refuse to start. Only emit server_name for naive (the unsupported alpn / allowInsecure on the node are ignored, as sing-box cannot honour them anyway). Refs: - https://sing-box.sagernet.org/configuration/outbound/naive/ (naive TLS supports only server_name / certificate / certificate_path / ech) - SagerNet/sing-box protocol/naive/outbound.go (v1.13.x) ~L47 `E.New("alpn is not supported on naive outbound")` (+ the insecure check) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sway-Chan
added a commit
to Sway-Chan/FlowZ
that referenced
this pull request
Jun 8, 2026
dododook
pushed a commit
that referenced
this pull request
Jun 8, 2026
Owner
|
Merged into main branch via local git merge, included in v3.5.0 release. Thank you for your contribution! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
FlowZ builds the
naiveoutbound's TLS block withalpnandinsecure:But sing-box's
naiveoutbound uses Cronet, which manages its own TLS, and onlyserver_name/certificate/certificate_path/echare supported. Passingalpn, orinsecure: true, makes sing-box hard-fail at startup:So a naive node that carries an ALPN (e.g. from an imported subscription) or has "allow insecure" enabled causes the core to refuse to start. Reproduced with the bundled
sing-box check(1.13.3):alpn:["h3"]→alpn is not supported on naive outbound;insecure:true→insecure is not supported on naive outbound;server_name-only → accepted.Fix
Emit only
server_namefor the naive outbound TLS. Thealpn/allowInsecurethe user may have set on the node are ignored, since sing-box's naive cannot honour them anyway (and the docs explicitly advise against self-signed certs for naive).References
server_name/certificate/certificate_path/ech: https://sing-box.sagernet.org/configuration/outbound/naive/protocol/naive/outbound.go(v1.13.x), ~L47:if len(options.TLS.ALPN) > 0 { return nil, E.New("alpn is not supported on naive outbound") }(plus the analogousinsecurecheck).Testing
tsc -p tsconfig.main.json,eslint,prettierclean; the post-fix naive outbound (server_nameonly) validated by the bundledsing-box check.🤖 Generated with Claude Code