From 3f0ec633a1c00493eb244470ef0e59968e8f92d2 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 15 Apr 2019 15:57:37 +0200 Subject: [PATCH] Issue #3464 - Split SslContextFactory into Client and Server Fixed instanceof check to maintain backwards compatibility. Signed-off-by: Simone Bordet --- .../org/eclipse/jetty/util/ssl/SslContextFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java index 2c935924f2b..e9216bdda48 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java @@ -53,6 +53,7 @@ import java.util.Set; import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; + import javax.net.ssl.CertPathTrustManagerParameters; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.KeyManager; @@ -1954,12 +1955,11 @@ public class SslContextFactory extends AbstractLifeCycle implements Dumpable sslParams.setCipherSuites(_selectedCipherSuites); if (_selectedProtocols != null) sslParams.setProtocols(_selectedProtocols); - if (this instanceof Server) + if (!(this instanceof Client)) { - Server server = (Server)this; - if (server.getWantClientAuth()) + if (getWantClientAuth()) sslParams.setWantClientAuth(true); - if (server.getNeedClientAuth()) + if (getNeedClientAuth()) sslParams.setNeedClientAuth(true); } return sslParams;