aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client/src/main/java9/ai/vespa/feed/client/impl/TlsDetailsFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespa-feed-client/src/main/java9/ai/vespa/feed/client/impl/TlsDetailsFactory.java')
-rw-r--r--vespa-feed-client/src/main/java9/ai/vespa/feed/client/impl/TlsDetailsFactory.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/vespa-feed-client/src/main/java9/ai/vespa/feed/client/impl/TlsDetailsFactory.java b/vespa-feed-client/src/main/java9/ai/vespa/feed/client/impl/TlsDetailsFactory.java
new file mode 100644
index 00000000000..f9903d9943d
--- /dev/null
+++ b/vespa-feed-client/src/main/java9/ai/vespa/feed/client/impl/TlsDetailsFactory.java
@@ -0,0 +1,20 @@
+// 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;
+
+/**
+ * {@link SSLEngine#getApplicationProtocol()} is not available on all JDK8 versions
+ * (https://bugs.openjdk.org/browse/JDK-8051498)
+ *
+ * @author bjorncs
+ */
+public class TlsDetailsFactory {
+ private TlsDetailsFactory() {}
+
+ public static TlsDetails create(SSLEngine e) {
+ return new TlsDetails(e.getSession(), e.getApplicationProtocol());
+ }
+}