Skip to content

Commit d229047

Browse files
committed
Fixed: unsupported cipher for Clash/Stash
1 parent cb21a8e commit d229047

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

backend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.14.6",
3+
"version": "2.14.7",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/producers/clash.js

+12
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ export default function Clash_Producer() {
4141
proxy.servername = proxy.sni;
4242
delete proxy.sni;
4343
}
44+
// https://dreamacro.github.io/clash/configuration/outbound.html#vmess
45+
if (
46+
isPresent(proxy, 'cipher') &&
47+
![
48+
'auto',
49+
'aes-128-gcm',
50+
'chacha20-poly1305',
51+
'none',
52+
].includes(proxy.cipher)
53+
) {
54+
proxy.cipher = 'auto';
55+
}
4456
}
4557

4658
delete proxy['tls-fingerprint'];

backend/src/core/proxy-utils/producers/stash.js

+13
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ export default function Stash_Producer() {
2828
proxy.servername = proxy.sni;
2929
delete proxy.sni;
3030
}
31+
// https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/docs/config.yaml#L400
32+
// https://stash.wiki/proxy-protocols/proxy-types#vmess
33+
if (
34+
isPresent(proxy, 'cipher') &&
35+
![
36+
'auto',
37+
'aes-128-gcm',
38+
'chacha20-poly1305',
39+
'none',
40+
].includes(proxy.cipher)
41+
) {
42+
proxy.cipher = 'auto';
43+
}
3144
} else if (proxy.type === 'tuic') {
3245
if (isPresent(proxy, 'alpn')) {
3346
proxy.alpn = Array.isArray(proxy.alpn)

0 commit comments

Comments
 (0)