mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 23:29:04 +08:00
fix: Failed to parse Surge/QX nodes with tls fingerprint
This commit is contained in:
parent
606cfed8da
commit
7834fd6056
6
backend/dist/cron-sync-artifacts.min.js
vendored
6
backend/dist/cron-sync-artifacts.min.js
vendored
File diff suppressed because one or more lines are too long
6
backend/dist/sub-store-parser.loon.min.js
vendored
6
backend/dist/sub-store-parser.loon.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
@ -155,7 +155,7 @@ tls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }
|
||||
tls_verification = comma "tls-verification" equals flag:bool {
|
||||
proxy["skip-cert-verify"] = !flag;
|
||||
}
|
||||
tls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:[^,] { proxy["tls-fingerprint"] = tls_fingerprint; }
|
||||
tls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
|
||||
|
||||
obfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }
|
||||
obfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }
|
||||
|
@ -153,7 +153,7 @@ tls_host = comma "tls-host" equals sni:domain { proxy.sni = sni; }
|
||||
tls_verification = comma "tls-verification" equals flag:bool {
|
||||
proxy["skip-cert-verify"] = !flag;
|
||||
}
|
||||
tls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:[^,] { proxy["tls-fingerprint"] = tls_fingerprint; }
|
||||
tls_fingerprint = comma "tls-cert-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
|
||||
|
||||
obfs_ss = comma "obfs" equals type:("http"/"tls"/"wss"/"ws"/"over-tls") { obfs.type = type; return type; }
|
||||
obfs_ssr = comma "obfs" equals type:("plain"/"http_simple"/"http_post"/"random_head"/"tls1.2_ticket_auth"/"tls1.2_ticket_fastauth") { obfs.type = type; return type; }
|
||||
|
@ -142,7 +142,7 @@ password = comma match:[^,]+ { proxy.password = match.join(""); }
|
||||
tls = comma "tls" equals flag:bool { proxy.tls = flag; }
|
||||
sni = comma "sni" equals sni:domain { proxy.sni = sni; }
|
||||
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
|
||||
tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:[^,] { proxy["tls-fingerprint"] = tls_fingerprint; }
|
||||
tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
|
||||
|
||||
snell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }
|
||||
snell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }
|
||||
|
@ -140,7 +140,7 @@ password = comma match:[^,]+ { proxy.password = match.join(""); }
|
||||
tls = comma "tls" equals flag:bool { proxy.tls = flag; }
|
||||
sni = comma "sni" equals sni:domain { proxy.sni = sni; }
|
||||
tls_verification = comma "skip-cert-verify" equals flag:bool { proxy["skip-cert-verify"] = flag; }
|
||||
tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:[^,] { proxy["tls-fingerprint"] = tls_fingerprint; }
|
||||
tls_fingerprint = comma "server-cert-fingerprint-sha256" equals tls_fingerprint:$[^,]+ { proxy["tls-fingerprint"] = tls_fingerprint.trim(); }
|
||||
|
||||
snell_psk = comma "psk" equals match:[^,]+ { proxy.psk = match.join(""); }
|
||||
snell_version = comma "version" equals match:$[0-9]+ { proxy.version = parseInt(match.trim()); }
|
||||
|
@ -60,6 +60,12 @@ describe('QX', function () {
|
||||
const proxy = parser.parse(input.QX);
|
||||
expect(proxy).eql(expected);
|
||||
});
|
||||
|
||||
it('test trojan + tls fingerprint', function () {
|
||||
const { input, expected } = testcases.TROJAN.TLS_FINGERPRINT;
|
||||
const proxy = parser.parse(input.QX);
|
||||
expect(proxy).eql(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('vmess', function () {
|
||||
|
@ -42,6 +42,12 @@ describe('Surge', function () {
|
||||
const proxy = parser.parse(input.Surge);
|
||||
expect(proxy).eql(expected);
|
||||
});
|
||||
|
||||
it('test trojan + tls fingerprint', function () {
|
||||
const { input, expected } = testcases.TROJAN.TLS_FINGERPRINT;
|
||||
const proxy = parser.parse(input.Surge);
|
||||
expect(proxy).eql(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('vmess', function () {
|
||||
|
@ -20,6 +20,9 @@ function createTestCases() {
|
||||
|
||||
const sni = 'sni.com';
|
||||
|
||||
const tls_fingerprint =
|
||||
'67:1B:C8:F2:D4:60:DD:A7:EE:60:DA:BB:A3:F9:A4:D7:C8:29:0F:3E:2F:75:B6:A9:46:88:48:7D:D3:97:7E:98';
|
||||
|
||||
const SS = {
|
||||
SIMPLE: {
|
||||
input: {
|
||||
@ -198,6 +201,23 @@ function createTestCases() {
|
||||
sni,
|
||||
},
|
||||
},
|
||||
TLS_FINGERPRINT: {
|
||||
input: {
|
||||
QX: `trojan=${server}:${port},password=${password},tls-verification=false,tls-host=${sni},tls-cert-sha256=${tls_fingerprint},tag=${name},over-tls=true`,
|
||||
Surge: `${name}=trojan,${server},${port},password=${password},skip-cert-verify=true,sni=${sni},tls=true,server-cert-fingerprint-sha256=${tls_fingerprint}`,
|
||||
},
|
||||
expected: {
|
||||
type: 'trojan',
|
||||
name,
|
||||
server,
|
||||
port,
|
||||
password,
|
||||
tls: true,
|
||||
'skip-cert-verify': true,
|
||||
sni,
|
||||
'tls-fingerprint': tls_fingerprint,
|
||||
},
|
||||
},
|
||||
};
|
||||
const VMESS = {
|
||||
SIMPLE: {
|
||||
|
6
backend/sub-store.min.js
vendored
6
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user