diff --git a/sslcontext-kickstart/src/main/java/nl/altindag/ssl/util/CertificateUtils.java b/sslcontext-kickstart/src/main/java/nl/altindag/ssl/util/CertificateUtils.java index f0b70e8a..410ff1d1 100644 --- a/sslcontext-kickstart/src/main/java/nl/altindag/ssl/util/CertificateUtils.java +++ b/sslcontext-kickstart/src/main/java/nl/altindag/ssl/util/CertificateUtils.java @@ -18,8 +18,6 @@ import nl.altindag.ssl.exception.GenericCertificateException; import nl.altindag.ssl.exception.GenericIOException; import nl.altindag.ssl.util.internal.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.net.ssl.X509TrustManager; import javax.security.auth.x500.X500Principal; @@ -69,8 +67,6 @@ */ public final class CertificateUtils { - private static final Logger LOGGER = LoggerFactory.getLogger(CertificateUtils.class); - private static final String CERTIFICATE_TYPE = "X.509"; private static final String P7B_HEADER = "-----BEGIN PKCS7-----"; private static final String P7B_FOOTER = "-----END PKCS7-----"; @@ -257,7 +253,6 @@ public static List parseDerCertificate(InputStream certificateStrea .generateCertificates(bufferedCertificateStream).stream() .collect(toUnmodifiableList()); } catch (CertificateException | IOException e) { - LOGGER.debug("There is no valid certificate present to parse. Please make sure to supply a valid der formatted certificate", e); return Collections.emptyList(); } } diff --git a/sslcontext-kickstart/src/test/java/nl/altindag/ssl/util/CertificateUtilsShould.java b/sslcontext-kickstart/src/test/java/nl/altindag/ssl/util/CertificateUtilsShould.java index 59010ee2..b89f7ba6 100644 --- a/sslcontext-kickstart/src/test/java/nl/altindag/ssl/util/CertificateUtilsShould.java +++ b/sslcontext-kickstart/src/test/java/nl/altindag/ssl/util/CertificateUtilsShould.java @@ -15,7 +15,6 @@ */ package nl.altindag.ssl.util; -import nl.altindag.log.LogCaptor; import nl.altindag.ssl.TestConstants; import nl.altindag.ssl.exception.GenericCertificateException; import nl.altindag.ssl.exception.GenericIOException; @@ -643,13 +642,11 @@ void throwsGenericIOExceptionWhenCloseOfTheStreamFails() throws IOException { } @Test - void generateDebugMessageWhenUnsupportedDataIsProvided() throws IOException { - try(LogCaptor logCaptor = LogCaptor.forClass(CertificateUtils.class); - ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream("Hello".getBytes())) { + void returnEmptyListOfCertificatesWhenUnsupportedDataIsProvided() throws IOException { + try(ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream("Hello".getBytes())) { List certificates = CertificateUtils.parseDerCertificate(byteArrayInputStream); assertThat(certificates).isEmpty(); - assertThat(logCaptor.getDebugLogs()).contains("There is no valid certificate present to parse. Please make sure to supply a valid der formatted certificate"); } }