This commit is contained in:
tarsin committed 2023-01-22 14:04:28 +08:00
1 parent 1c0785432b
commit 92c94aa22a
2 files changed
+2 -2

No files matched your search

@@ -124,7 +124,7 @@ object EhDns : Dns {
?: Dns.SYSTEM.lookup(hostname)
}
fun isInHost(hostname: String): Boolean {
fun isInHosts(hostname: String): Boolean {
return hosts.contains(hostname) || (builtInHosts.contains(hostname) && Settings.getBuiltInHosts())
}
}
@@ -34,7 +34,7 @@ object EhSSLSocketFactory : SSLSocketFactory() {
}
override fun createSocket(s: Socket, host: String, port: Int, autoClose: Boolean): Socket {
val address = s.inetAddress.hostAddress.takeIf { EhDns.isInHost(host) }
val address = s.inetAddress.hostAddress.takeIf { EhDns.isInHosts(host) }
val socket = sslSocketFactory.createSocket(s, address ?: host, port, autoClose) as SSLSocket
val sslSession = socket.session
Log.d(