diff --git a/app/src/main/java/io/nekohasekai/sagernet/fmt/http/HttpFmt.kt b/app/src/main/java/io/nekohasekai/sagernet/fmt/http/HttpFmt.kt index a1900674..ea997ca0 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/fmt/http/HttpFmt.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/fmt/http/HttpFmt.kt @@ -16,9 +16,10 @@ fun parseHttp(link: String): HttpBean { serverPort = httpUrl.port username = httpUrl.username password = httpUrl.password + setTLS(httpUrl.scheme == "https") sni = httpUrl.queryParameter("sni") + allowInsecure = security == "tls" && sni.isNullOrEmpty() name = httpUrl.fragment - setTLS(httpUrl.scheme == "https") } } diff --git a/app/src/main/java/io/nekohasekai/sagernet/group/RawUpdater.kt b/app/src/main/java/io/nekohasekai/sagernet/group/RawUpdater.kt index 51c3bb6c..d10bde3f 100644 --- a/app/src/main/java/io/nekohasekai/sagernet/group/RawUpdater.kt +++ b/app/src/main/java/io/nekohasekai/sagernet/group/RawUpdater.kt @@ -248,6 +248,8 @@ object RawUpdater : GroupUpdater() { password = proxy["password"]?.toString() setTLS(proxy["tls"]?.toString() == "true") sni = proxy["sni"]?.toString() + allowInsecure = (proxy["skip-cert-verify"]?.toString() == "true") || + (security == "tls" && sni.isNullOrEmpty()) name = proxy["name"]?.toString() }) }