TLS only on release builds

This commit is contained in:
topjohnwu
2022-01-22 22:57:34 -08:00
parent 8eac6c0b48
commit e0410b6f10
3 changed files with 11 additions and 6 deletions

View File

@@ -47,8 +47,7 @@ private class DnsResolver(client: OkHttpClient) : Dns {
if (Config.doh) {
try {
return doh.lookup(hostname)
} catch (e: UnknownHostException) {
}
} catch (e: UnknownHostException) {}
}
return Dns.SYSTEM.lookup(hostname)
}
@@ -64,7 +63,7 @@ fun createOkHttpClient(context: Context): OkHttpClient {
level = HttpLoggingInterceptor.Level.BASIC
})
} else {
builder.connectionSpecs(listOf(ConnectionSpec.RESTRICTED_TLS))
builder.connectionSpecs(listOf(ConnectionSpec.MODERN_TLS))
}
builder.dns(DnsResolver(builder.build()))