Skip to content

Commit e80fb16

Browse files
authored
Fix logging logic on mdn processing completion (#484)
* Version updates * Enhance MDN processing to produce more logging when an MDN response is not what is expected. * Release notes * Fix logging WARN message that should have been a trace log. * Update release version number. * Fix log level on logging record meant for TRACE level logging. * Documentation minor additions. * Release notes
1 parent d32cfb6 commit e80fb16

9 files changed

Lines changed: 27 additions & 14 deletions

File tree

RELEASE-NOTES.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# OpenAS2 Server
2-
# Version 4.7.0
2+
# Version 4.7.1
33
# RELEASE NOTES
44
-----
5-
The OpenAS2 project is pleased to announce the release of OpenAS2 4.7.0
5+
The OpenAS2 project is pleased to announce the release of OpenAS2 4.7.1
66

7-
The release download file is: OpenAS2Server-4.7.0.zip
7+
The release download file is: OpenAS2Server-4.7.1.zip
88

99
The zip file contains a PDF document (OpenAS2HowTo.pdf) providing information on installing and using the application.
1010
## NOTE: Testing covers Java 11 to 21.
1111
## Java 8 is NO LONGER SUPPORTED.
1212

13-
Version 4.7.0 - 2025-10-28
13+
Version 4.7.1 - 2025-10-20
1414

15-
This is a minor enhancement release.
16-
1. Enhance MDN processing to extract possible responses from partner that provide information on why the partner rejected the AS2 transaction.
15+
This is a minor bufix release.
16+
1. Fix boolean return values from processMDN method causing wrong log message.
17+
2. Fix logging WARN message that should have been a TRACE log.
1718

1819

1920
##Upgrade Notes

Server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!-- DO NOT CHANGE THIS "groupId" WITHOUT CHANGING XMLSession.getManifestAttributes.MANIFEST_VENDOR_ID_ATTRIB -->
88
<groupId>net.sf.openas2</groupId>
99
<artifactId>OpenAS2</artifactId>
10-
<version>4.7.0</version>
10+
<version>4.7.1</version>
1111
<relativePath>../pom.xml</relativePath>
1212
</parent>
1313

Server/src/main/java/org/openas2/processor/sender/AS2SenderModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private void processResponse(Message msg, ResponseWrapper response) {
237237
// Assume that appropriate logging and state handling was done upstream if an error occurred so only log state change for success
238238
boolean mdnResponseIssue = AS2Util.processMDN((AS2Message) msg, response.getBody(), null, false, getSession(), this.getClass());
239239
if (mdnResponseIssue) {
240-
logger.warn("There was an issue identified processing the response fropm the p[artner. Review upstream log messages for details on the probklem.");
240+
logger.warn("There was an issue identified processing the response from the partner. Review upstream log messages for details on the problem.");
241241
}
242242
} catch (Exception e) {
243243
/* Processing of the MDN would have done extensive error handling so only log an error if the error

Server/src/main/java/org/openas2/util/AS2Util.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ public static boolean processMDN(AS2Message msg, byte[] data, OutputStream out,
535535
} catch (MessagingException e1) {
536536
msg.setLogMsg("Failed to create mimebodypart from received MDN data for partnership " + mdn.getPartnership().getName() + ": " + org.openas2.util.Logging.getExceptionMsg(e1));
537537
logger.error(msg.getLogMsg(), e1);
538-
return AS2Util.resend(session, sourceClass, SenderModule.DO_SEND, msg, new OpenAS2Exception(e1), true, false);
538+
AS2Util.resend(session, sourceClass, SenderModule.DO_SEND, msg, new OpenAS2Exception(e1), true, false);
539+
return true;
539540
}
540541
CertificateFactory cFx = session.getCertificateFactory(CertificateFactory.COMPID_AS2_CERTIFICATE_FACTORY);
541542
String x509_alias = mdn.getPartnership().getAlias(Partnership.PTYPE_RECEIVER);
@@ -617,7 +618,7 @@ public static boolean processMDN(AS2Message msg, byte[] data, OutputStream out,
617618
logger.info(msg.getLogMsg());
618619

619620
cleanupFiles(msg, false);
620-
return true;
621+
return false;
621622

622623
}
623624

Server/src/main/java/org/openas2/util/HTTPUtil.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ private static SSLConnectionSocketFactory buildSslFactory(URL urlObj, Map<String
430430
String selfSignedCN = System.getProperty("org.openas2.cert.TrustSelfSignedCN");
431431
boolean isTrustSelfSignedCNHandling = (selfSignedCN != null && selfSignedCN.contains(urlObj.getHost()))?true:false;
432432

433-
LOG.warn("SSL factory building using:\n\tisExtendedSelfsignedTrustCheck: {}\n\toverrideSslChecks: {}\n\tisTrustSelfSignedCNHandling: {}", isExtendedSelfsignedTrustCheck, overrideSslChecks, isTrustSelfSignedCNHandling);
433+
if (LOG.isTraceEnabled()) {
434+
LOG.trace("SSL factory building values: isExtendedSelfsignedTrustCheck - {} ::: overrideSslChecks - {} ::: isTrustSelfSignedCNHandling - {}", isExtendedSelfsignedTrustCheck, overrideSslChecks, isTrustSelfSignedCNHandling);
435+
}
434436
// Find a keystore to verify the self signed certs against if required
435437
// Even if TrustSelfSignedCN is passed, use the custom keystore if it is defined
436438
KeyStore selfsignedCertsKeystore = null;
@@ -447,7 +449,9 @@ private static SSLConnectionSocketFactory buildSslFactory(URL urlObj, Map<String
447449
try {
448450
// Trust own CA and all self-signed certs
449451
sslcontext = SSLContexts.custom().loadTrustMaterial(selfsignedCertsKeystore, new TrustSelfSignedStrategy()).build();
450-
LOG.debug("SSL context built using self signed trust store...");
452+
if (LOG.isTraceEnabled()) {
453+
LOG.trace("SSL context built using self signed trust store...");
454+
}
451455
} catch (Exception e) {
452456
throw new OpenAS2Exception("Attempted connection using self-signed manager failed connecting to : " + urlObj.toString(), e);
453457
}

changes.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
**IMPORTANT NOTE**: Please review upgrade notes in the RELEASE-NOTES.md if you are upgrading
22

3-
Version 4.7.0 - 2025-10-28
3+
Version 4.7.1 - 2025-10-20
4+
5+
This is a minor enhancement release.
6+
1. Fix boolean return values from processMDN method causing wrong log message.
7+
2. Fix logging WARN message that should have been a TRACE log.
8+
9+
10+
Version 4.7.0 - 2025-10-18
411

512
This is a minor enhancement release.
613
1. Enhance MDN processing to extract possible responses from partner that provide information on why the partner rejected the AS2 transaction.

docs/OpenAS2HowTo.odt

581 Bytes
Binary file not shown.

docs/OpenAS2HowTo.pdf

-332 Bytes
Binary file not shown.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>net.sf.openas2</groupId>
77
<artifactId>OpenAS2</artifactId>
8-
<version>4.7.0</version>
8+
<version>4.7.1</version>
99
<name>OpenAS2</name>
1010
<packaging>pom</packaging>
1111

0 commit comments

Comments
 (0)