Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanups for SslClientCertAuthenticator. #6376

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -36,7 +36,7 @@
* <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}
Expand Down
Expand Up @@ -35,10 +35,10 @@
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
{
/**
Expand Down
Expand Up @@ -37,23 +37,14 @@
* 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
Expand Down Expand Up @@ -135,19 +126,18 @@ public boolean secureResponse(ServletRequest req, ServletResponse res, boolean m
}

/**
* @return true if SSL certificate has to be validated
* @return true if SSL certificate has to be validated.
*/
public boolean isValidateCerts()
{
return validateCerts;
}

/**
* @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;
}

}