verifySSL() - debug info

DEBUG report like this:

SSL Verification: 
		passed: true, request is secure: true, 
		SSL is required for: EXTERNAL, 
		SSL is required for remote addr 192.168.100.123: false
This commit is contained in:
Agile Developer 2017-02-02 21:18:14 +01:00 committed by GitHub
parent 68a171f36c
commit cde3e87ad9

View file

@ -159,11 +159,26 @@ public abstract class RequestAuthenticator {
} }
protected boolean verifySSL() { protected boolean verifySSL() {
if (!facade.getRequest().isSecure() && deployment.getSslRequired().isRequired(facade.getRequest().getRemoteAddr())) { boolean verificationPassed = facade.getRequest().isSecure()
|| !deployment.getSslRequired().isRequired(facade.getRequest().getRemoteAddr());
if (!verificationPassed){
log.warn("SSL is required to authenticate"); log.warn("SSL is required to authenticate");
return true;
} }
return false;
if (log.isDebugEnabled()) {
final String remoteAddr = facade.getRequest().getRemoteAddr();
final SslRequired sslRequired = deployment.getSslRequired();
log.debugf("SSL Verification: " +
"\n\tpassed: %s, request is secure: %s, " +
"\n\tSSL is required for: %s, " +
"\n\tSSL is required for remote addr %s: %s",
verificationPassed,
facade.getRequest().isSecure(),
sslRequired.name(),
remoteAddr,
sslRequired.isRequired(remoteAddr));
}
return !verificationPassed;
} }
protected boolean isAutodetectedBearerOnly(HttpFacade.Request request) { protected boolean isAutodetectedBearerOnly(HttpFacade.Request request) {