mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
fix(sub): include ECH config in TLS share links and JSON subscription
echConfigList was stored under tlsSettings.settings but the share-link and JSON-subscription generators only read fingerprint and pinnedPeerCertSha256 from that bag, silently dropping ECH from VLESS, Trojan and VMess links. Read echConfigList alongside them and flatten it into tlsSettings.echConfigList for the JSON subscription. Closes #4933
This commit is contained in:
parent
d6d2085d60
commit
f8e902a7b6
3 changed files with 14 additions and 0 deletions
|
|
@ -232,6 +232,7 @@ export function genVmessLink(input: GenVmessLinkInput): string {
|
|||
if (tlsSettings.serverName.length > 0) obj.sni = tlsSettings.serverName;
|
||||
if (tlsSettings.settings.fingerprint.length > 0) obj.fp = tlsSettings.settings.fingerprint;
|
||||
if (tlsSettings.alpn.length > 0) obj.alpn = tlsSettings.alpn.join(',');
|
||||
if (tlsSettings.settings.echConfigList.length > 0) obj.ech = tlsSettings.settings.echConfigList;
|
||||
if (tlsSettings.settings.pinnedPeerCertSha256.length > 0) {
|
||||
obj.pcs = tlsSettings.settings.pinnedPeerCertSha256.join(',');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -258,6 +258,9 @@ func (s *SubJsonService) tlsData(tData map[string]any) map[string]any {
|
|||
if fingerprint, ok := tlsClientSettings["fingerprint"].(string); ok {
|
||||
tlsData["fingerprint"] = fingerprint
|
||||
}
|
||||
if ech, ok := tlsClientSettings["echConfigList"].(string); ok && ech != "" {
|
||||
tlsData["echConfigList"] = ech
|
||||
}
|
||||
if pins, ok := tlsClientSettings["pinnedPeerCertSha256"].([]any); ok && len(pins) > 0 {
|
||||
tlsData["pinnedPeerCertSha256"] = pins
|
||||
}
|
||||
|
|
|
|||
|
|
@ -894,6 +894,11 @@ func applyShareTLSParams(stream map[string]any, params map[string]string) {
|
|||
if fpValue, ok := searchKey(tlsSettings, "fingerprint"); ok {
|
||||
params["fp"], _ = fpValue.(string)
|
||||
}
|
||||
if echValue, ok := searchKey(tlsSettings, "echConfigList"); ok {
|
||||
if ech, _ := echValue.(string); ech != "" {
|
||||
params["ech"] = ech
|
||||
}
|
||||
}
|
||||
if pins, ok := pinnedSha256List(tlsSettings); ok {
|
||||
params["pcs"] = strings.Join(pins, ",")
|
||||
}
|
||||
|
|
@ -919,6 +924,11 @@ func applyVmessTLSParams(stream map[string]any, obj map[string]any) {
|
|||
if fpValue, ok := searchKey(tlsSettings, "fingerprint"); ok {
|
||||
obj["fp"], _ = fpValue.(string)
|
||||
}
|
||||
if echValue, ok := searchKey(tlsSettings, "echConfigList"); ok {
|
||||
if ech, _ := echValue.(string); ech != "" {
|
||||
obj["ech"] = ech
|
||||
}
|
||||
}
|
||||
if pins, ok := pinnedSha256List(tlsSettings); ok {
|
||||
obj["pcs"] = strings.Join(pins, ",")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue