Skip to content

fix: preserve VLESS ML-KEM encryption and improve Clash/mihomo compatibility - #410

Open
yingxiaomo wants to merge 2 commits into
7Sageer:mainfrom
yingxiaomo:fix/vless-mlkem-xhttp-and-clash-skip-cert
Open

fix: preserve VLESS ML-KEM encryption and improve Clash/mihomo compatibility#410
yingxiaomo wants to merge 2 commits into
7Sageer:mainfrom
yingxiaomo:fix/vless-mlkem-xhttp-and-clash-skip-cert

Conversation

@yingxiaomo

Copy link
Copy Markdown

Summary

  • Preserve VLESS post-quantum encryption (e.g. mlkem768x25519plus...) and xhttp-opts (path/mode/host) when converting share links to Clash/mihomo.
  • Keep client-fingerprint (fp) for VLESS/VMess/Trojan Clash export.
  • Parse share-link insecure=0/1 correctly with parseBool instead of truthy string checks.
  • For Clash/mihomo export only, force skip-cert-verify: true so nodes that advertise insecure=0 but fail strict certificate verification still work (common with public share links). Parsers still preserve the original flag for other targets.

Motivation

  1. Quantum VLESS share links were parsed as VLESS but lost encryption / incomplete xhttp options in Clash output, so mihomo could not use them.
  2. !!params.insecure treated "0" as true, flipping skip-cert-verify incorrectly.
  3. Even with correct insecure=0 parsing, many real TUIC/Hysteria2 share nodes fail under mihomo's strict TLS verification while working in V2RayN; Clash export now prefers usability for multi-subscription conversion.

Test plan

  • Full suite: npx vitest run — 31 files / 215 tests passed
  • Synthetic fixtures for ML-KEM + xhttp + insecure flags (test/issue-vless-mlkem-xhttp.test.js)
  • Manual smoke: VLESS (mlkem/xhttp/ws/reality), TUIC, Hysteria2, Trojan, SS, VMess share links
  • Confirmed Clash export sets skip-cert-verify: true for TUIC/Hy2 even when link has insecure=0

Notes

  • Scope is limited to parse + Clash export paths; no architecture changes.
  • No real subscription credentials in tests (synthetic data only).

- Keep encryption/xhttp-opts/mode/fp for VLESS share-link conversion
- Parse insecure=0 correctly with parseBool
- Do not default TUIC skip-cert-verify to true
Only Clash/mihomo export is forced to skip-cert-verify: true so share
nodes that claim insecure=0 still work under strict clients. Parsers
still preserve the original insecure flag for other targets.
@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

@yingxiaomo is attempting to deploy a commit to the 7sageer's projects Team on Vercel.

A member of the Team first needs to authorize it.

@yingxiaomo yingxiaomo closed this Jul 18, 2026
@yingxiaomo yingxiaomo reopened this Jul 18, 2026
@yingxiaomo
yingxiaomo force-pushed the fix/vless-mlkem-xhttp-and-clash-skip-cert branch from 4c2208a to 9d936bb Compare July 18, 2026 19:56
@Gwenep

Gwenep commented Jul 29, 2026

Copy link
Copy Markdown

赞一个 我也发现了一样的问题 转换后丢失了信息 但是导出clash完全跳过证书验证是否不妥 不够安全 一个带证书正常的域名节点应该是可以正常证书校验的

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.

2 participants