From b07511f01b2e62e3f9cea75f7e247a4010addc27 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Tue, 10 Mar 2020 13:30:30 +0800 Subject: [PATCH] opt 1.2.3 --- app/Services/ServerService.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Services/ServerService.php b/app/Services/ServerService.php index ff762e9d..35b07299 100644 --- a/app/Services/ServerService.php +++ b/app/Services/ServerService.php @@ -87,12 +87,19 @@ class ServerService } if ((int)$server->tls) { + $tlsSettings = json_decode($server->tlsSettings); $json->inbound->streamSettings->security = 'tls'; $tls = (object)[ 'certificateFile' => '/home/v2ray.crt', 'keyFile' => '/home/v2ray.key' ]; $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; }