mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 01:11:46 +08:00 
			
		
		
		
	subscription: Improved TLS support
Signed-off-by: Beta Soft <betaxab@gmail.com>
This commit is contained in:
		| @@ -53,6 +53,17 @@ class ClientController extends Controller | |||||||
|         $uri = ''; |         $uri = ''; | ||||||
|         foreach ($server as $item) { |         foreach ($server as $item) { | ||||||
|             $uri .= "vmess=" . $item->host . ":" . $item->port . ", method=none, password=" . $user->v2ray_uuid . ", fast-open=false, udp-relay=false, tag=" . $item->name; |             $uri .= "vmess=" . $item->host . ":" . $item->port . ", method=none, password=" . $user->v2ray_uuid . ", fast-open=false, udp-relay=false, tag=" . $item->name; | ||||||
|  |             if ($item->tls) { | ||||||
|  |                 $tlsSettings = json_decode($item->tlsSettings); | ||||||
|  |                 $uri .= ', obfs=over-tls'; | ||||||
|  |                 if (isset($tlsSettings->allowInsecure)) { | ||||||
|  |                     // Default: tls-verification=true | ||||||
|  |                     $uri .= ', tls-verification=' . ($tlsSettings->allowInsecure ? "false" : "true"); | ||||||
|  |                 } | ||||||
|  |                 if (isset($tlsSettings->serverName)) { | ||||||
|  |                     $uri .= ', obfs-host=' . $tlsSettings->serverName; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|             if ($item->network == 'ws') { |             if ($item->network == 'ws') { | ||||||
|                 $uri .= ', obfs=' . ($item->tls ? 'wss' : 'ws'); |                 $uri .= ', obfs=' . ($item->tls ? 'wss' : 'ws'); | ||||||
|                 if ($item->networkSettings) { |                 if ($item->networkSettings) { | ||||||
| @@ -106,7 +117,7 @@ class ClientController extends Controller | |||||||
|                 $tlsSettings = json_decode($item->tlsSettings); |                 $tlsSettings = json_decode($item->tlsSettings); | ||||||
|                 $proxies .= ', tls=' . ($item->tls ? "true" : "false"); |                 $proxies .= ', tls=' . ($item->tls ? "true" : "false"); | ||||||
|                 if (isset($tlsSettings->allowInsecure)) { |                 if (isset($tlsSettings->allowInsecure)) { | ||||||
|                   $proxies .= ', skip-cert-verify=true'; |                   $proxies .= ', skip-cert-verify=' . ($tlsSettings->allowInsecure ? "true" : "false"); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             if ($item->network == 'ws') { |             if ($item->network == 'ws') { | ||||||
| @@ -163,8 +174,9 @@ class ClientController extends Controller | |||||||
|             $array['alterId'] = $user->v2ray_alter_id; |             $array['alterId'] = $user->v2ray_alter_id; | ||||||
|             $array['cipher'] = 'auto'; |             $array['cipher'] = 'auto'; | ||||||
|             if ($item->tls) { |             if ($item->tls) { | ||||||
|  |                 $tlsSettings = json_decode($item->tlsSettings); | ||||||
|                 $array['tls'] = true; |                 $array['tls'] = true; | ||||||
|                 $array['skip-cert-verify'] = true; |                 if (isset($tlsSettings->allowInsecure)) $array['skip-cert-verify'] = ($tlsSettings->allowInsecure ? true : false ); | ||||||
|             } |             } | ||||||
|             if ($item->network == 'ws') { |             if ($item->network == 'ws') { | ||||||
|                 $array['network'] = $item->network; |                 $array['network'] = $item->network; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user