use of com.questdb.std.ex.NetworkError in project questdb by bluestreak01.
the class SslConfig method createSSLContext.
private SSLContext createSSLContext() {
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
SecureRandom sr = new SecureRandom();
sr.nextInt();
sslContext.init(keyManagerFactory != null ? keyManagerFactory.getKeyManagers() : null, trustManagerFactory != null ? trustManagerFactory.getTrustManagers() : (trustAll ? allowAllTrustManagers : null), sr);
return sslContext;
} catch (Exception e) {
throw new NetworkError(e);
}
}
use of com.questdb.std.ex.NetworkError in project questdb by bluestreak01.
the class Net method parseIPv4.
private static int parseIPv4(CharSequence address) {
int ip = 0;
int count = 0;
int lo = 0;
int hi;
try {
while ((hi = Chars.indexOf(address, lo, '.')) > -1) {
int n = Numbers.parseInt(address, lo, hi);
ip = (ip << 8) | n;
count++;
lo = hi + 1;
}
if (count != 3) {
throw new NetworkError("Invalid ip address: " + address);
}
return (ip << 8) | Numbers.parseInt(address, lo, address.length());
} catch (NumericException e) {
throw new NetworkError("Invalid ip address: " + address);
}
}
Aggregations