Support verify TLS hostname
This commit is contained in:
@@ -139,6 +139,12 @@ msgstr "协议类型"
|
||||
msgid "Domain Address"
|
||||
msgstr "域名地址"
|
||||
|
||||
msgid "TLS Hostname Verify"
|
||||
msgstr "校验TLS主机名"
|
||||
|
||||
msgid "Set TLS hostname to verify"
|
||||
msgstr "设置校验TLS主机名"
|
||||
|
||||
msgid "TLS SNI name"
|
||||
msgstr "TLS SNI名称"
|
||||
|
||||
|
||||
@@ -39,6 +39,14 @@ o:value("https", translate("https"))
|
||||
o.default = "udp"
|
||||
o.rempty = false
|
||||
|
||||
---- TLS host check
|
||||
o = s:option(Value, "tls_host_check", translate("TLS Hostname Verify"), translate("Set TLS hostname to verify"))
|
||||
o.default = ""
|
||||
o.datatype = "string"
|
||||
o.rempty = true
|
||||
o:depends("type", "tls")
|
||||
o:depends("type", "https")
|
||||
|
||||
---- SNI host name
|
||||
o = s:option(Value, "host_name", translate("TLS SNI name"), translate("Sets the server name indication"))
|
||||
o.default = ""
|
||||
|
||||
@@ -160,6 +160,7 @@ load_server()
|
||||
config_get "port" "$section" "port" ""
|
||||
config_get "type" "$section" "type" "udp"
|
||||
config_get "ip" "$section" "ip" ""
|
||||
config_get "tls_host_check" "$section" "tls_host_check" ""
|
||||
config_get "host_name" "$section" "host_name" ""
|
||||
config_get "http_host" "$section" "http_host" ""
|
||||
config_get "server_group" "$section" "server_group" ""
|
||||
@@ -191,6 +192,10 @@ load_server()
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z "$tls_host_check" ]; then
|
||||
ADDITIONAL_ARGS="$ADDITIONAL_ARGS -tls-host-check $tls_host_check"
|
||||
fi
|
||||
|
||||
if [ ! -z "$host_name" ]; then
|
||||
ADDITIONAL_ARGS="$ADDITIONAL_ARGS -host-name $host_name"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user