Skip to content

Commit

Permalink
Merge pull request #6376 from eclipse/jetty-10.0.x-SslClientCertAuthe…
Browse files Browse the repository at this point in the history
…nticatorCleanup

Cleanups for SslClientCertAuthenticator.
  • Loading branch information
lachlan-roberts committed Jun 17, 2021
2 parents f1e3a9e + e77ba1e commit 82e2140
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
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;
}

}

0 comments on commit 82e2140

Please sign in to comment.