Skip to content

Commit 997b6f9

Browse files
yarrrlyAleksandr Safronov
authored andcommitted
fix(proxy): stop emitting allowInsecure for domains with a valid cert
need_valid_ssl already yields False for the modes that are supposed to have a certificate, but the servernames branch overwrote it with True for every non-Reality domain. The guard never gates: re.split on an empty string returns [''], which is truthy, so the block runs for every domain. Xray-core has removed allowInsecure, so configs carrying it are now rejected. Refs hiddify/Hiddify-Manager#5438
1 parent 486a86d commit 997b6f9

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

hiddifypanel/hutils/proxy/shared.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,16 +350,13 @@ def sni_host_server_extractor(domain_db: Domain, hconfigs):
350350
server = str(random_or_none(hutils.network.get_domain_ips_cached(server)) or server)
351351

352352
allow_insecure = not domain_db.need_valid_ssl
353-
if all_snis := split_pattern.split((domain_db.servernames or "").strip()):
353+
if all_snis := [s for s in split_pattern.split((domain_db.servernames or "").strip()) if s]:
354354
sni = random_or_none(all_snis) or sni
355355
if domain_db.is_reality():
356356
allow_insecure = False
357357
if hconfigs[ConfigEnum.core_type] == "singbox": # TODO
358358
sni = all_snis[0]
359359

360-
else:
361-
allow_insecure = True
362-
363360
base = {
364361
"sni": sni,
365362
"host": host,

0 commit comments

Comments
 (0)