Skip to content

Commit

Permalink
Fixed: unsupported cipher for Clash/Stash
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Aug 14, 2023
1 parent cb21a8e commit d229047
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.6",
"version": "2.14.7",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
12 changes: 12 additions & 0 deletions backend/src/core/proxy-utils/producers/clash.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ export default function Clash_Producer() {
proxy.servername = proxy.sni;
delete proxy.sni;
}
// https://dreamacro.github.io/clash/configuration/outbound.html#vmess
if (
isPresent(proxy, 'cipher') &&
![
'auto',
'aes-128-gcm',
'chacha20-poly1305',
'none',
].includes(proxy.cipher)
) {
proxy.cipher = 'auto';
}
}

delete proxy['tls-fingerprint'];
Expand Down
13 changes: 13 additions & 0 deletions backend/src/core/proxy-utils/producers/stash.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ export default function Stash_Producer() {
proxy.servername = proxy.sni;
delete proxy.sni;
}
// https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/docs/config.yaml#L400
// https://stash.wiki/proxy-protocols/proxy-types#vmess
if (
isPresent(proxy, 'cipher') &&
![
'auto',
'aes-128-gcm',
'chacha20-poly1305',
'none',
].includes(proxy.cipher)
) {
proxy.cipher = 'auto';
}
} else if (proxy.type === 'tuic') {
if (isPresent(proxy, 'alpn')) {
proxy.alpn = Array.isArray(proxy.alpn)
Expand Down

0 comments on commit d229047

Please sign in to comment.