From 0e5dd4c6f3f2f0f9c479cffad1b8edcd165efb8c Mon Sep 17 00:00:00 2001 From: Henry Borasch <Henry.Borasch@sinc.de> Date: Tue, 7 Mar 2023 12:24:48 +0100 Subject: [PATCH] moved test certificates to other module, where it is actually needed --- .../TEST-PCA20.pem | 0 .../validation/DefaultValidationService.java | 22 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) rename {core => client}/src/test/resources/trusted-test-root-certificates/TEST-PCA20.pem (100%) diff --git a/core/src/test/resources/trusted-test-root-certificates/TEST-PCA20.pem b/client/src/test/resources/trusted-test-root-certificates/TEST-PCA20.pem similarity index 100% rename from core/src/test/resources/trusted-test-root-certificates/TEST-PCA20.pem rename to client/src/test/resources/trusted-test-root-certificates/TEST-PCA20.pem 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 9c5f29a57..4b2dab852 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 @@ -239,17 +239,17 @@ public class DefaultValidationService implements ValidationService { private List<String> loadTrustedRootCertificates() { - List<X509Certificate> trustedRootCertificates = rootCertificates.stream() - .map(FileUtil::convertToX509Certificate).collect(Collectors.toList()); - List<String> encodedCertificates = trustedRootCertificates.stream().map(cert -> { - try { - return Base64.encode(cert.getEncoded()).toString(); - } catch (CertificateEncodingException e) { - throw new RootCertificateException(e); - } - }).collect(Collectors.toList()); - - return encodedCertificates; + List<String> trustedRootCertificates = rootCertificates.stream() + .map(FileUtil::convertToX509Certificate) + .map(cert -> { + try { + return Base64.encode(cert.getEncoded()).toString(); + } catch (CertificateEncodingException e) { + throw new RootCertificateException(e); + } + }).collect(Collectors.toList()); + + return trustedRootCertificates; } private boolean isProxySet() { -- GitLab