fix: correct SNI domain configuration paths in SingBox protocol

- Fix Trojan protocol to use 'server_name' instead of 'tls_settings.server_name'
- Fix Hysteria protocol to use 'tls.server_name' instead of 'tls_settings.server_name'
- Align with Server model configuration and General protocol implementation
- Resolves missing SNI domains in sing-box configuration generation

This fixes the inconsistency where SNI domains were missing for certain
protocols while working correctly in General protocol handler.
This commit is contained in:
Takeshi Matsumoto 2025-08-16 02:44:17 +09:00
parent cd6b07e655
commit ca8f904121

View File

@ -310,7 +310,7 @@ class SingBox extends AbstractProtocol
'insecure' => (bool) data_get($protocol_settings, 'allow_insecure', false),
]
];
if ($serverName = data_get($protocol_settings, 'tls_settings.server_name')) {
if ($serverName = data_get($protocol_settings, 'server_name')) {
$array['tls']['server_name'] = $serverName;
}
$transport = match (data_get($protocol_settings, 'network')) {
@ -353,7 +353,7 @@ class SingBox extends AbstractProtocol
}
}
if ($serverName = data_get($protocol_settings, 'tls_settings.server_name')) {
if ($serverName = data_get($protocol_settings, 'tls.server_name')) {
$baseConfig['tls']['server_name'] = $serverName;
}
$speedConfig = [