From c6cbb703cb47ccbbc2c1479aaa2ed0c969f35891 Mon Sep 17 00:00:00 2001 From: Istvan Toth Date: Thu, 23 Jan 2025 15:02:23 +0100 Subject: [PATCH] WIP Use Htppclient 5.5 SNAPSHOT and MutualSpnegoScheme --- .../avatica/remote/AvaticaCommonsHttpClientImpl.java | 10 +++++----- gradle.properties | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/org/apache/calcite/avatica/remote/AvaticaCommonsHttpClientImpl.java b/core/src/main/java/org/apache/calcite/avatica/remote/AvaticaCommonsHttpClientImpl.java index 44beaa7b8..ab8571153 100644 --- a/core/src/main/java/org/apache/calcite/avatica/remote/AvaticaCommonsHttpClientImpl.java +++ b/core/src/main/java/org/apache/calcite/avatica/remote/AvaticaCommonsHttpClientImpl.java @@ -24,8 +24,8 @@ import org.apache.hc.client5.http.auth.AuthScope; import org.apache.hc.client5.http.auth.Credentials; import org.apache.hc.client5.http.auth.CredentialsProvider; -import org.apache.hc.client5.http.auth.KerberosConfig; import org.apache.hc.client5.http.auth.KerberosCredentials; +import org.apache.hc.client5.http.auth.MutualKerberosConfig; import org.apache.hc.client5.http.auth.StandardAuthScheme; import org.apache.hc.client5.http.auth.UsernamePasswordCredentials; import org.apache.hc.client5.http.classic.methods.HttpPost; @@ -34,7 +34,7 @@ import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider; import org.apache.hc.client5.http.impl.auth.BasicSchemeFactory; import org.apache.hc.client5.http.impl.auth.DigestSchemeFactory; -import org.apache.hc.client5.http.impl.auth.SPNegoSchemeFactory; +import org.apache.hc.client5.http.impl.auth.MutualSpnegoSchemeFactory; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; import org.apache.hc.client5.http.impl.classic.HttpClientBuilder; @@ -77,8 +77,8 @@ public class AvaticaCommonsHttpClientImpl implements AvaticaHttpClient, HttpClie private static final boolean USE_CANONICAL_HOSTNAME = Boolean .parseBoolean(System.getProperty("avatica.http.spnego.use_canonical_hostname", "true")); private static final boolean STRIP_PORT_ON_SERVER_LOOKUP = true; - private static final KerberosConfig KERBEROS_CONFIG = - KerberosConfig.custom().setStripPort(STRIP_PORT_ON_SERVER_LOOKUP) + private static final MutualKerberosConfig KERBEROS_CONFIG = + MutualKerberosConfig.custom().setStripPort(STRIP_PORT_ON_SERVER_LOOKUP) .setUseCanonicalHostname(USE_CANONICAL_HOSTNAME) .build(); private static AuthScope anyAuthScope = new AuthScope(null, -1); @@ -219,7 +219,7 @@ CloseableHttpResponse execute(HttpPost post, HttpClientContext context) this.authRegistry = RegistryBuilder.create() .register(StandardAuthScheme.SPNEGO, - new SPNegoSchemeFactory(KERBEROS_CONFIG, SystemDefaultDnsResolver.INSTANCE)) + new MutualSpnegoSchemeFactory(KERBEROS_CONFIG, SystemDefaultDnsResolver.INSTANCE)) .build(); this.credentialsProvider = new BasicCredentialsProvider(); diff --git a/gradle.properties b/gradle.properties index 06f4f3db5..3e1572cad 100644 --- a/gradle.properties +++ b/gradle.properties @@ -65,8 +65,8 @@ guava.version=32.1.1-jre hamcrest.version=1.3 hsqldb.version=2.4.1 h2.version=1.4.197 -httpclient5.version=5.4.1 -httpcore5.version=5.3.1 +httpclient5.version=5.5-alpha1-SNAPSHOT +httpcore5.version=5.3.2 jackson.version=2.15.4 jcip-annotations.version=1.0-1 jcommander.version=1.72