fix(singbox): make shadowsocks ciphers, naive uTLS, and naive libcronet work - #104
Merged
Conversation
forced_core sent every shadowsocks profile to sing-box (its default tls.security is Tls), but sing-box implements neither `plain`, `chacha20-poly1305` nor `xchacha20-poly1305` — those profiles failed to launch (`unknown method`). Route the three Xray-only ciphers to Xray; keep the 2022 AEAD + IETF chacha on sing-box. Surfaced by validating generated configs against the real cores.
sing-box rejects a naive outbound that carries uTLS (`uTLS is not supported on naive outbound`), but a profile's default fingerprint made the builder emit it, so every naive profile failed to initialise. Skip uTLS for naive (as already done for the QUIC outbounds). Reference fixture updated. Surfaced by validating generated configs against the real cores.
The sing-box desktop release is a purego build that dlopen()s libcronet from the
sing-box binary's own directory; without it every naive profile fails with
`cronet: library not found`. The library ships inside the sing-box release archive
but fetch-cores-desktop.sh dropped it.
Stage libcronet.{so,dll} next to sing-box (script), bundle it as a resource
(tauri.{windows,linux}.conf.json, mirroring wintun.dll), and copy it into the
portable zips. Bundle placement for the installers is verified by nightly.
15 tasks
The new tauri.linux.conf.json / tauri.windows.conf.json libcronet resources are
validated by tauri-build at compile time, but the compile-smoke jobs (rust nix
clippy/codegen, desktop-linux, desktop-windows) don't stage the cores — so the
build failed with 'resource path binaries/libcronet.{so,dll} doesn't exist'.
Stub a placeholder before each compile, mirroring the existing wintun.dll stub.
13 tasks
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.
Summary
Fixes three real, user-facing breakages in the sing-box data path that the config-validation harness (#103) surfaced by running generated configs through the real cores. All three meant a profile our UI happily builds would fail to launch.
shadowsocks cipher routing —
forced_coresent every shadowsocks profile to sing-box (its defaulttls.securityisTls), but sing-box implements neitherplain,chacha20-poly1305norxchacha20-poly1305, so those profiles died withunknown method. Now the three Xray-only ciphers route to Xray (which does implement them); the 2022 AEAD ciphers and the IETF chacha variant stay on sing-box.naive uTLS — sing-box rejects a naive outbound that carries uTLS (
uTLS is not supported on naive outbound), but a profile's default fingerprint made the builder emit it, so every naive profile failed to initialise. uTLS is now skipped for naive (as it already was for the QUIC outbounds). Reference fixture updated.libcronet shipping — even with (2) fixed, naive failed at runtime with
cronet: library not found: the sing-box desktop release is a purego build thatdlopen()slibcronet.{so,dll}from the sing-box binary's own directory. The library ships inside the sing-box release archive, butfetch-cores-desktop.shextracted only thesing-boxbinary and dropped it. Now staged next to sing-box, bundled as a resource (mirroringwintun.dll), and copied into the portable zips.After all three, the full enum-driven validation matrix (every protocol × transport × security × ss cipher) is accepted by the pinned cores — naive included.
Affected layer
frontend/— React Web UIcrates/·src-tauri/— Rust core / backend / Tauri desktopmodule/— Android installable zipscripts/— build / release helpers.github/Verification
Rust (
crates/·src-tauri/):cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace(incl. newshadowsocks_method_routing_splits_by_core+naive_outbound_omits_utls)cargo run -p kasumi-desktop --bin codegenleavesgitcleanCores (manual, pinned versions):
fetch-cores-desktop.shstageslibcronet.sonext to sing-boxChecklist
libcronet.{so,dll}stays gitignored underbinaries/, staged at build time)frontend/src/generated/regenerated from Rust, not hand-editedNotes for reviewers
libcronetin a flat dir next to sing-box (reliable); for the installers (deb/AppImage/NSIS/MSI) it's added as a Tauri resource mirroringwintun.dll. If nightly shows the resource doesn't land in sing-box's directory on Linux (AppImage is self-contained, and cores are spawned with a cleared env soLD_LIBRARY_PATHwon't help), the follow-up is to stage it into the core directory at runtime.