mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-30 01:34:59 +03:00
feat(sub): export TLS cipher suites as the cs query param in share links (#6825)
Hosts and TLS inbounds can set cipher suites, but they reached only the JSON and Clash subscriptions; raw share links never carried them, so clients that read cs from links (v2rayNG forks used with fp=unsafe) had to enter them by hand. Share links now emit cs from the host or inbound TLS settings, the panel's own link generator and previews do the same, and both link parsers (the Go one and the panel's outbound import) read cs back into tlsSettings.cipherSuites.
This commit is contained in:
@@ -830,6 +830,35 @@ func TestApplyExternalProxyTLSParams_SetsPinnedPeerCert(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyExternalProxyTLSParams_SetsCipherSuites(t *testing.T) {
|
||||
params := map[string]string{"security": "tls"}
|
||||
ep := map[string]any{
|
||||
"dest": "proxy.example.com",
|
||||
"cipherSuites": "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256",
|
||||
}
|
||||
|
||||
applyExternalProxyTLSParams(ep, params, "tls")
|
||||
|
||||
if params["cs"] != "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256" {
|
||||
t.Fatalf("cs = %q, want TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256", params["cs"])
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyShareTLSParams_SetsCipherSuites(t *testing.T) {
|
||||
stream := map[string]any{
|
||||
"security": "tls",
|
||||
"tlsSettings": map[string]any{
|
||||
"cipherSuites": "TLS_AES_128_GCM_SHA256",
|
||||
},
|
||||
}
|
||||
params := map[string]string{}
|
||||
applyShareTLSParams(stream, params)
|
||||
|
||||
if params["cs"] != "TLS_AES_128_GCM_SHA256" {
|
||||
t.Fatalf("cs = %q, want TLS_AES_128_GCM_SHA256", params["cs"])
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyExternalProxyTLSObj_SetsPinnedPeerCert(t *testing.T) {
|
||||
obj := map[string]any{"tls": "tls"}
|
||||
ep := map[string]any{
|
||||
|
||||
Reference in New Issue
Block a user