opt 1.2.3

This commit is contained in:
Tokumeikoi 2020-03-10 13:30:30 +08:00
parent a13809ac02
commit b07511f01b

View File

@ -87,12 +87,19 @@ class ServerService
} }
if ((int)$server->tls) { if ((int)$server->tls) {
$tlsSettings = json_decode($server->tlsSettings);
$json->inbound->streamSettings->security = 'tls'; $json->inbound->streamSettings->security = 'tls';
$tls = (object)[ $tls = (object)[
'certificateFile' => '/home/v2ray.crt', 'certificateFile' => '/home/v2ray.crt',
'keyFile' => '/home/v2ray.key' 'keyFile' => '/home/v2ray.key'
]; ];
$json->inbound->streamSettings->tlsSettings = new \StdClass(); $json->inbound->streamSettings->tlsSettings = new \StdClass();
if (isset($tlsSettings->serverName)) {
$json->inbound->streamSettings->tlsSettings->serverName = (string)$tlsSettings->serverName;
}
if (isset($tlsSettings->allowInsecure)) {
$json->inbound->streamSettings->tlsSettings->allowInsecure = (int)$tlsSettings->allowInsecure ? true : false;
}
$json->inbound->streamSettings->tlsSettings->certificates[0] = $tls; $json->inbound->streamSettings->tlsSettings->certificates[0] = $tls;
} }