Skip to content

Commit

Permalink
Added logging if certificate is expired
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Oct 31, 2024
1 parent 1c6ba4f commit 3f96d3d
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,12 @@ private static void _checkReceiverAPCert (@Nullable final X509Certificate aRecei

if (eCertCheckResult.isInvalid ())
{
throw new Phase4PeppolException ("The configured receiver AP certificate is not valid (at " +
aNow +
") and cannot be used for sending. Aborting. Reason: " +
eCertCheckResult.getReason ());
final String sMsg = "The configured receiver AP certificate is not valid (at " +
aNow +
") and cannot be used for sending. Aborting. Reason: " +
eCertCheckResult.getReason ();
LOGGER.error (sMsg);
throw new Phase4PeppolException (sMsg);
}
}

Expand Down Expand Up @@ -798,7 +800,10 @@ protected ESuccess finishFields () throws Phase4Exception
// Certificate from e.g. SMP lookup (may throw an exception)
final X509Certificate aReceiverCert = m_aEndpointDetailProvider.getReceiverAPCertificate ();
if (m_bCheckReceiverAPCertificate)
{
// Throws Phase4PeppolException in case of error
_checkReceiverAPCert (aReceiverCert, m_aCertificateConsumer, ETriState.UNDEFINED, null);
}
else
{
LOGGER.warn ("The check of the receiver's Peppol AP certificate was explicitly disabled.");
Expand Down

0 comments on commit 3f96d3d

Please sign in to comment.