Skip to content

Commit

Permalink
Simplify conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Dec 31, 2024
1 parent f9a553a commit e7c3c1d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit e7c3c1d

Please sign in to comment.