Skip to content

Commit

Permalink
WIP Use Htppclient 5.5 SNAPSHOT and MutualSpnegoScheme
Browse files Browse the repository at this point in the history
  • Loading branch information
stoty committed Jan 23, 2025
1 parent 0b2cba6 commit c6cbb70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -219,7 +219,7 @@ CloseableHttpResponse execute(HttpPost post, HttpClientContext context)

this.authRegistry = RegistryBuilder.<AuthSchemeFactory>create()
.register(StandardAuthScheme.SPNEGO,
new SPNegoSchemeFactory(KERBEROS_CONFIG, SystemDefaultDnsResolver.INSTANCE))
new MutualSpnegoSchemeFactory(KERBEROS_CONFIG, SystemDefaultDnsResolver.INSTANCE))
.build();

this.credentialsProvider = new BasicCredentialsProvider();
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6cbb70

Please sign in to comment.