From a005bfd360131877a4a9617914f8edb11a7f09fd Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 7 Feb 2019 16:24:22 +0100 Subject: [PATCH] Issue #3154 - Add support for javax.net.ssl.HostnameVerifier to HttpClient. Fixed compilation errors after merge. Signed-off-by: Simone Bordet --- .../org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java index ce412a5ff17..1a6feaa2f6c 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslClientConnectionFactory.java @@ -143,7 +143,8 @@ public class SslClientConnectionFactory implements ClientConnectionFactory HostnameVerifier verifier = sslContextFactory.getHostnameVerifier(); if (verifier != null) { - String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY); + InetSocketAddress address = (InetSocketAddress)context.get(ClientConnector.SOCKET_ADDRESS_CONTEXT_KEY); + String host = address.getHostString(); try { if (!verifier.verify(host, event.getSSLEngine().getSession()))