From 9db925810bf34d8d7cef597f010fff59c0b8b6cf Mon Sep 17 00:00:00 2001 From: Henry Borasch <Henry.Borasch@sinc.de> Date: Thu, 9 Mar 2023 15:24:11 +0100 Subject: [PATCH] make JWKValidator throw always exceptions if something fails --- .../core/validation/DefaultValidationService.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/src/main/java/dev/fitko/fitconnect/core/validation/DefaultValidationService.java b/core/src/main/java/dev/fitko/fitconnect/core/validation/DefaultValidationService.java index 4b2dab852..fa75c8e58 100644 --- a/core/src/main/java/dev/fitko/fitconnect/core/validation/DefaultValidationService.java +++ b/core/src/main/java/dev/fitko/fitconnect/core/validation/DefaultValidationService.java @@ -213,11 +213,7 @@ public class DefaultValidationService implements ValidationService { } private JWKValidator addLogLevel(final JWKValidatorBuilder.JWKValidatorX5CErrorHandling validator) { - if (config.getCurrentEnvironment().isAllowInsecurePublicKey()) { - return validator.withoutThrowingExceptions().withErrorLogLevel(LogLevel.WARN).build(); - } else { - return validator.withThrowingExceptions().withErrorLogLevel(LogLevel.ERROR).build(); - } + return validator.withThrowingExceptions().withErrorLogLevel(LogLevel.ERROR).build(); } private void validateWithoutCertChain(final RSAKey publicKey, final KeyOperation purpose) throws JWKValidationException { -- GitLab