Cleanups for SslClientCertAuthenticator.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2021-06-09 15:13:31 +10:00
parent 3a8af443f5
commit e77ba1e2b2
3 changed files with 8 additions and 18 deletions

View File

@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
* <li>{@link org.eclipse.jetty.security.authentication.DigestAuthenticator}</li>
* <li>{@link org.eclipse.jetty.security.authentication.FormAuthenticator}</li>
* <li>{@link org.eclipse.jetty.security.authentication.ClientCertAuthenticator}</li>
* <li>{@link SslClientCertAuthenticator}</li>
* <li>{@link org.eclipse.jetty.security.authentication.SslClientCertAuthenticator}</li>
* </ul>
* All authenticators derived from {@link org.eclipse.jetty.security.authentication.LoginAuthenticator} are
* wrapped with a {@link org.eclipse.jetty.security.authentication.DeferredAuthentication}

View File

@ -35,10 +35,10 @@ import org.eclipse.jetty.util.security.CertificateValidator;
import org.eclipse.jetty.util.security.Constraint;
import org.eclipse.jetty.util.security.Password;
@Deprecated
/**
* @deprecated Prefer using {@link SslClientCertAuthenticator}
*/
@Deprecated
public class ClientCertAuthenticator extends LoginAuthenticator
{
/**

View File

@ -37,23 +37,14 @@ import org.eclipse.jetty.util.ssl.SslContextFactory;
* The client certificates available in the request will be verified against the configured {@link SslContextFactory} instance
* </p>
*/
public class SslClientCertAuthenticator
extends LoginAuthenticator
public class SslClientCertAuthenticator extends LoginAuthenticator
{
/**
* Set to true if SSL certificate validation is not required
* per default it's true as this is the goal of this implementation
*/
private final SslContextFactory sslContextFactory;
private boolean validateCerts = true;
private SslContextFactory sslContextFactory;
public SslClientCertAuthenticator(SslContextFactory sslContextFactory)
{
super();
Objects.nonNull(sslContextFactory);
this.sslContextFactory = sslContextFactory;
this.sslContextFactory = Objects.requireNonNull(sslContextFactory);
}
@Override
@ -135,7 +126,7 @@ public class SslClientCertAuthenticator
}
/**
* @return true if SSL certificate has to be validated
* @return true if SSL certificate has to be validated.
*/
public boolean isValidateCerts()
{
@ -143,11 +134,10 @@ public class SslClientCertAuthenticator
}
/**
* @param validateCerts true if SSL certificates have to be validated
* @param validateCerts true if SSL certificates have to be validated.
*/
public void setValidateCerts(boolean validateCerts)
{
validateCerts = validateCerts;
this.validateCerts = validateCerts;
}
}