KEYCLOAK-16540 X.509 Authentication logs Exception when no client cert
When no client cert is present the variable clientCert is null. In this case the log statement leads to a NPE which then gets logged as an error.
This commit is contained in:
parent
d70de48ba9
commit
4652fd4fcd
1 changed files with 3 additions and 3 deletions
|
@ -123,10 +123,10 @@ public class NginxProxySslClientCertificateLookup extends AbstractClientCertific
|
|||
|
||||
// Get the client certificate
|
||||
X509Certificate clientCert = getCertificateFromHttpHeader(httpRequest, sslClientCertHttpHeader);
|
||||
log.debugf("End user certificate found : Subject DN=[%s] SerialNumber=[%s]", clientCert.getSubjectDN().toString(), clientCert.getSerialNumber().toString() );
|
||||
|
||||
|
||||
if (clientCert != null) {
|
||||
|
||||
log.debugf("End user certificate found : Subject DN=[%s] SerialNumber=[%s]", clientCert.getSubjectDN(), clientCert.getSerialNumber());
|
||||
|
||||
// Rebuilding the end user certificate chain using Keycloak Truststore
|
||||
X509Certificate[] certChain = buildChain(clientCert);
|
||||
if ( certChain == null || certChain.length == 0 ) {
|
||||
|
|
Loading…
Reference in a new issue