Improved TLS check

This commit is contained in:
M66B
2022-01-08 08:02:24 +01:00
parent b16cbbdc18
commit 3e8e83a321
2 changed files with 73 additions and 36 deletions

View File

@@ -502,11 +502,11 @@ public class ConnectionHelper {
return addr;
}
static boolean isLocalIPAddress(String host) {
boolean numeric = ConnectionHelper.jni_is_numeric_address(host);
if (!numeric)
return false;
static boolean isNumericAddress(String host) {
return ConnectionHelper.jni_is_numeric_address(host);
}
static boolean isLocalAddress(String host) {
try {
InetAddress addr = ConnectionHelper.from6to4(InetAddress.getByName(host));
return (addr.isSiteLocalAddress() || addr.isLinkLocalAddress());