From e7c3c1df54eca0e25b7dd33734c4140536512c40 Mon Sep 17 00:00:00 2001 From: "Mateusz \"Serafin\" Gajewski" Date: Mon, 30 Dec 2024 17:01:54 +0100 Subject: [PATCH] Simplify conditions --- .../main/java/io/trino/client/uri/HttpClientFactory.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/trino-client/src/main/java/io/trino/client/uri/HttpClientFactory.java b/client/trino-client/src/main/java/io/trino/client/uri/HttpClientFactory.java index 570ee5ec332..796a42b4060 100644 --- a/client/trino-client/src/main/java/io/trino/client/uri/HttpClientFactory.java +++ b/client/trino-client/src/main/java/io/trino/client/uri/HttpClientFactory.java @@ -125,10 +125,6 @@ public static OkHttpClient.Builder unauthenticatedClientBuilder(TrinoUri uri, St setupTimeouts(builder, toIntExact(uri.getTimeout().toMillis()), TimeUnit.MILLISECONDS); setupHttpLogging(builder, uri.getHttpLoggingLevel()); - if (!uri.isUseSecureConnection()) { - setupInsecureSsl(builder); - } - if (uri.isUseSecureConnection()) { ConnectionProperties.SslVerificationMode sslVerificationMode = uri.getSslVerification(); if (sslVerificationMode.equals(FULL) || sslVerificationMode.equals(CA)) { @@ -156,6 +152,9 @@ public static OkHttpClient.Builder unauthenticatedClientBuilder(TrinoUri uri, St setupInsecureSsl(builder); } } + else { + setupInsecureSsl(builder); + } uri.getDnsResolver().ifPresent(resolverClass -> builder.dns(instantiateDnsResolver(resolverClass, uri.getDnsResolverContext())::lookup));