Skip to content

Commit 948cccf

Browse files
authored
fix: hysteria2 should default to TLS when security param is missing (7Sageer#345)
Hysteria2 protocol requires TLS by design. When parsing hysteria2:// URIs without explicit security parameter, the parser should default to 'tls' before calling createTlsConfig(). This fixes 'TLS required' errors for hysteria2 nodes that only specify insecure=1 without security=tls. Fixes 7Sageer#340
1 parent 3c92e81 commit 948cccf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/parsers/protocols/hysteria2Parser.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export function parseHysteria2(url) {
1919
password = params.auth;
2020
}
2121

22+
// Hysteria2 requires TLS by protocol design
23+
if (!params.security) params.security = 'tls';
2224
const tls = createTlsConfig(params);
2325
const obfs = {};
2426
if (params['obfs-password']) {

0 commit comments

Comments
 (0)