Skip to content

profile import: ignore TLS fields of a VMess JSON link without TLS - #346

Merged
aimalygin merged 1 commit into
aimalygin:mainfrom
huzgnm:fix/vmess-tls-fields-without-tls
Nov 24, 2026
Merged

aimalygin merged 1 commit into
aimalygin:mainfrom
huzgnm:fix/vmess-tls-fields-without-tls

Conversation

@huzgnm

@huzgnm huzgnm commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Panels such as V2Board write fp on every base64 JSON vmess:// link, also when tls is empty. v2rayN builds TLS settings only when tls names a security, so there the field configures nothing. Here the importer kept it and stream_settings refused the leftover parameter, so a plain WebSocket link failed with "profile contains an unsupported setting".

With tls absent, empty or none, the JSON dialect now drops sni, alpn and fp before the stream mapping. A link with TLS maps them into tlsSettings as before; the URI dialect and the REALITY fields are unchanged.

Fixes #343

Verification

  • Added or updated regression tests — vmess_json_ignores_tls_fields_without_tls (plain link imports without tlsSettings; TLS link still gets fingerprint)
  • Added or updated benchmarks for performance claims — not applicable
  • Ran formatting, strict Clippy, and relevant tests — cargo fmt --check, cargo clippy -p xray-config --all-targets --all-features -- -D warnings, cargo test -p xray-config --test vmess_import_tests --test profile_import_tests --test tooling_tests
  • Updated compatibility or user documentation — docs/config-compatibility.md, CHANGELOG.md (Unreleased)
  • Used only synthetic endpoints and credentials

Compatibility and security

Profile import only. JSON VMess links without TLS that were rejected now import as plain profiles; links with TLS, the URI dialect and REALITY handling are unchanged. No config schema, FFI ABI, lifecycle or resource-limit change.

Panels such as V2Board write `fp` on every base64 JSON vmess:// link,
also when `tls` is empty. v2rayN builds TLS settings only when `tls`
names a security, so there the field configures nothing. Here the
importer kept it and stream_settings refused the leftover parameter, so
a plain WebSocket link failed with "profile contains an unsupported
setting".

With `tls` absent, empty or `none`, the JSON dialect now drops `sni`,
`alpn` and `fp` before the stream mapping. A link with TLS maps them
into tlsSettings as before; the URI dialect and the REALITY fields are
unchanged.
aimalygin added a commit that referenced this pull request Nov 24, 2026
Contributor wave 14: VMess link TLS fields, provider app-message hook, traffic-triggered re-probes (#346, #347, #349, #308)
@aimalygin
aimalygin merged commit 126b23a into aimalygin:main Nov 24, 2026
huzgnm pushed a commit to huzgnm/xray-rust that referenced this pull request Nov 24, 2026
…-messages

apple: let a provider subclass answer its own app messages

CHANGELOG.md: both Unreleased entries kept, this one after aimalygin#346's.
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.

VMess import: base64 JSON link with "tls":"" and "fp" fails as "unsupported setting"

2 participants