Skip to content

Commit

Permalink
fix: enable insecure when tls is enabled but sni is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Restia-Ashbell committed Oct 4, 2024
1 parent fdddce3 commit 8845d6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/io/nekohasekai/sagernet/group/RawUpdater.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
}
Expand Down

0 comments on commit 8845d6b

Please sign in to comment.