fix: correct know issues

This commit is contained in:
xboard 2025-01-17 10:21:45 +08:00
parent ef8cc8b9a0
commit 0bbdf7a558

View File

@ -184,15 +184,21 @@ class SingBox implements ProtocolInterface
'fingerprint' => Helper::getRandFingerprint() 'fingerprint' => Helper::getRandFingerprint()
] ]
]; ];
switch ($protocol_settings['tls']) {
case 1:
if ($serverName = data_get($protocol_settings, 'tls_settings.server_name')) { if ($serverName = data_get($protocol_settings, 'tls_settings.server_name')) {
$tlsConfig['server_name'] = $serverName; $tlsConfig['server_name'] = $serverName;
} }
if ($protocol_settings['tls'] == 2) { break;
case 2:
$tlsConfig['server_name'] = data_get($protocol_settings, 'reality_settings.server_name');
$tlsConfig['reality'] = [ $tlsConfig['reality'] = [
'enabled' => true, 'enabled' => true,
'public_key' => data_get($protocol_settings, 'reality_settings.public_key'), 'public_key' => data_get($protocol_settings, 'reality_settings.public_key'),
'short_id' => data_get($protocol_settings, 'reality_settings.short_id') 'short_id' => data_get($protocol_settings, 'reality_settings.short_id')
]; ];
break;
} }
$array['tls'] = $tlsConfig; $array['tls'] = $tlsConfig;