浏览代码

Merge pull request #366 from Mattraks/dev

Fix the problem of empty items in tls and xtls configuration
coolsnowwolf 4 年之前
父节点
当前提交
c3055b7d38
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua

+ 2 - 2
luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua

@@ -118,13 +118,13 @@ local Xray = {
 		streamSettings = {
 		streamSettings = {
 			network = server.transport or "tcp",
 			network = server.transport or "tcp",
 			security = (server.xtls == '1') and "xtls" or (server.tls == '1') and "tls" or nil,
 			security = (server.xtls == '1') and "xtls" or (server.tls == '1') and "tls" or nil,
-			tlsSettings = (server.tls == '1') and {
+			tlsSettings = (server.tls == '1' and (server.insecure == "1" or server.tls_host or server.fingerprint)) and {
 				-- tls
 				-- tls
 				fingerprint = server.fingerprint,
 				fingerprint = server.fingerprint,
 				allowInsecure = (server.insecure == "1") and true or nil,
 				allowInsecure = (server.insecure == "1") and true or nil,
 				serverName = server.tls_host
 				serverName = server.tls_host
 			} or nil,
 			} or nil,
-			xtlsSettings = (server.xtls == '1') and {
+			xtlsSettings = (server.xtls == '1' and (server.insecure == "1" or server.tls_host or server.fingerprint)) and {
 				-- xtls
 				-- xtls
 				allowInsecure = (server.insecure == "1") and true or nil,
 				allowInsecure = (server.insecure == "1") and true or nil,
 				serverName = server.tls_host
 				serverName = server.tls_host