summaryrefslogtreecommitdiffstats
path: root/vespa-feed-client/src/main/java/ai/vespa/feed/client
diff options
context:
space:
mode:
Diffstat (limited to 'vespa-feed-client/src/main/java/ai/vespa/feed/client')
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java8
-rw-r--r--vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/TlsDetailsFactory.java16
2 files changed, 19 insertions, 5 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java
index 62cd56f21ce..decb5021f8f 100644
--- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java
@@ -15,7 +15,6 @@ import org.apache.hc.core5.http.message.BasicHeader;
import org.apache.hc.core5.http2.config.H2Config;
import org.apache.hc.core5.net.URIAuthority;
import org.apache.hc.core5.reactor.IOReactorConfig;
-import org.apache.hc.core5.reactor.ssl.TlsDetails;
import org.apache.hc.core5.util.Timeout;
import javax.net.ssl.SSLContext;
@@ -131,10 +130,9 @@ class ApacheCluster implements Cluster {
throw new IllegalStateException("No adequate SSL cipher suites supported by the JVM");
ClientTlsStrategyBuilder tlsStrategyBuilder = ClientTlsStrategyBuilder.create()
- .setTlsDetailsFactory(sslEngine ->
- new TlsDetails(sslEngine.getSession(), sslEngine.getApplicationProtocol()))
- .setCiphers(allowedCiphers)
- .setSslContext(sslContext);
+ .setTlsDetailsFactory(TlsDetailsFactory::create)
+ .setCiphers(allowedCiphers)
+ .setSslContext(sslContext);
if (builder.hostnameVerifier != null)
tlsStrategyBuilder.setHostnameVerifier(builder.hostnameVerifier);
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/TlsDetailsFactory.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/TlsDetailsFactory.java
new file mode 100644
index 00000000000..5183ce61761
--- /dev/null
+++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/TlsDetailsFactory.java
@@ -0,0 +1,16 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package ai.vespa.feed.client.impl;
+
+import org.apache.hc.core5.reactor.ssl.TlsDetails;
+
+import javax.net.ssl.SSLEngine;
+
+/**
+ * @author bjorncs
+ */
+public class TlsDetailsFactory {
+ private TlsDetailsFactory() {}
+
+ public static TlsDetails create(SSLEngine e) { return new TlsDetails(e.getSession(), "h2"); /*h2 == HTTP2*/ }
+}
+