Add support for adding skip-cert-verify flag to Clash/R subscription

This commit is contained in:
Tindy X committed 2020-01-01 22:38:21 +08:00
1 parent d95990b094
commit 144725213f
4 files changed
+11 -1

No files matched your search

+1
View File
@@ -93,6 +93,7 @@ rename_node=\(?((x|X)?(\d+)(\.?\d+)?)((\s?倍率?)|(x|X))\)?@$1x
udp_flag=false
tcp_fast_open_flag=false
sort_flag=false
skip_cert_verify_flag=true
[managed_config]
;Append a '#!MANAGED-CONFIG' info to Surge configurations
+5 -1
View File
@@ -34,7 +34,7 @@ extern std::mutex on_configuring;
//preferences
string_array renames, emojis;
bool add_emoji = false, remove_old_emoji = false, append_proxy_type = true;
bool udp_flag = false, tfo_flag = false, do_sort = false;
bool udp_flag = false, tfo_flag = false, scv_flag = false, do_sort = false;
std::string proxy_ruleset, proxy_subscription;
std::string clash_rule_base;
@@ -197,6 +197,8 @@ void readConf()
tfo_flag = ini.GetBool("tcp_fast_open_flag");
if(ini.ItemExist("sort_flag"))
do_sort = ini.GetBool("sort_flag");
if(ini.ItemExist("skip_cert_verify_flag"))
scv_flag = ini.GetBool("skip_cert_verify_flag");
}
ini.EnterSection("managed_config");
@@ -321,6 +323,7 @@ std::string subconverter(RESPONSE_CALLBACK_ARGS)
std::string group = UrlDecode(getUrlArg(argument, "group")), upload = getUrlArg(argument, "upload"), upload_path = getUrlArg(argument, "upload_path"), version = getUrlArg(argument, "ver");
std::string append_type = getUrlArg(argument, "append_type"), tfo = getUrlArg(argument, "tfo"), udp = getUrlArg(argument, "udp"), nodelist = getUrlArg(argument, "list");
std::string include = UrlDecode(getUrlArg(argument, "include")), exclude = UrlDecode(getUrlArg(argument, "exclude")), sort_flag = getUrlArg(argument, "sort");
std::string scv = getUrlArg(argument, "scv");
std::string base_content, output_content;
string_array extra_group, extra_ruleset, include_remarks, exclude_remarks;
std::string groups = urlsafe_base64_decode(getUrlArg(argument, "groups")), ruleset = urlsafe_base64_decode(getUrlArg(argument, "ruleset")), config = UrlDecode(getUrlArg(argument, "config"));
@@ -400,6 +403,7 @@ std::string subconverter(RESPONSE_CALLBACK_ARGS)
ext.tfo = tfo.size() ? tfo == "true" : tfo_flag;
ext.udp = udp.size() ? udp == "true" : udp_flag;
ext.sort_flag = sort_flag.size() ? sort_flag == "true" : do_sort;
ext.skip_cert_verify = scv.size() ? scv == "true" : scv_flag;
ext.nodelist = nodelist == "true";
ext.surge_ssr_path = surge_ssr_path;
+4
View File
@@ -552,6 +552,8 @@ YAML::Node netchToClash(std::vector<nodeInfo> &nodes, YAML::Node &yamlnode, stri
singleproxy["plugin-opts"]["path"] = getUrlArg(pluginopts, "path");
singleproxy["plugin-opts"]["tls"] = pluginopts.find("tls") != pluginopts.npos;
singleproxy["plugin-opts"]["mux"] = pluginopts.find("mux") != pluginopts.npos;
if(ext.skip_cert_verify)
singleproxy["plugin-opts"]["skip-cert-verify"] = true;
}
}
else if(x.linkType == SPEEDTEST_MESSAGE_FOUNDVMESS)
@@ -567,6 +569,8 @@ YAML::Node netchToClash(std::vector<nodeInfo> &nodes, YAML::Node &yamlnode, stri
singleproxy["alterId"] = stoi(aid);
singleproxy["cipher"] = method;
singleproxy["tls"] = tlssecure;
if(ext.skip_cert_verify)
singleproxy["skip-cert-verify"] = true;
if(transproto == "ws")
{
singleproxy["network"] = transproto;
+1
View File
@@ -19,6 +19,7 @@ struct extra_settings
bool tfo = false;
bool nodelist = false;
bool sort_flag = false;
bool skip_cert_verify = false;
std::string surge_ssr_path;
};