OpenAS2 / OpenAs2App

OpenAS2 is a java-based implementation of the EDIINT AS2 standard. It is intended to be used as a server. It is extremely configurable and supports a wide variety of signing and encryption algorithms.
https://sourceforge.net/projects/openas2/
BSD 2-Clause "Simplified" License
182 stars 136 forks source link

Troubleshooting encrpytion errors #299

Closed piersmacdonald closed 1 year ago

piersmacdonald commented 2 years ago

Howdy, I'm trying to figure out some compatibility issues with an OpenAS2 server and get a failed MDN that says automatic-action/MDN-sent-automatically; processed/Error:decryption-failed

Trying to reproduce in OpenAS2 the response verbose logs show this:

022-09-26 23:01:54.207 ERROR OpenAS2Exception: Error occurred:: Malformed content.
    Sources: {message=Message From:{as2_id=TESTPI, name=PartnerA, email=as2msgs@partnera.com, x509_alias=partnera}To:{as2_id=TESTINGOPENAS2, name=MyCompany, email=as2msgs@openas2.com, x509_alias=mycompany}
Headers:{Content-Type=application/pkcs7-mime; smime-type=enveloped-data; 
name=smime.p7m, Accept=application/json, text/plain, */*, Message-ID=<test-0094bfad-f6ca-4960-aa31-7c01fffe550d@orderful-Theas-MBP.lan>, As2-From=TESTPI, As2-To=TESTINGOPENAS2, As2-Version=1.0, Disposition-Notification-To=TESTPI, Disposition-Notification-Options=signed-receipt-protocol=required,pkcs7-signature; signed-receipt-micalg=required,sha-256, Content-Transfer-Encoding=base64, Content-Disposition=null, Date=Mon, 26 Sep 2022 23:01:53 +0000, MIME-Version=1.0, User-Agent=axios/0.21.4, Content-Length=5576, x-datadog-trace-id=8025217437283227534, x-datadog-parent-id=3382581270929917396, x-datadog-sampling-priority=1, x-datadog-tags=_dd.p.upstream_services=QG5yd2wvbm9kZQ==|1|0|1, Host=localhost:4080, Connection=keep-alive}
Attributes:{HTTP_REQUEST_TYPE=POST, destination_ip=/172.17.0.2, destination_port=10080, HTTP_REQUEST_URL=/, source_port=60210, source_ip=/172.17.0.1}
MDN:MDN From:{as2_id=TESTINGOPENAS2, name=MyCompany, email=as2msgs@openas2.com, x509_alias=mycompany}To:{as2_id=TESTPI, name=PartnerA, email=as2msgs@partnera.com, x509_alias=partnera}
Headers:{Date=Mon, 26 Sep 2022 23:01:54 +0000, From=as2msgs@openas2.com, Message-Id=<OPENAS2-26092022230154+0000-21a7b495-259d-46fe-98d3-992506dedfb0@TESTPI_TESTINGOPENAS2>, Subject=Your Requested MDN Response re: null, MIME-Version=1.0, Content-Type=multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="----=_Part_1_1366489909.1664233314182", AS2-To=TESTPI, AS2-From=TESTINGOPENAS2, AS2-Version=1.1, Connection=close, TE, User-Agent=OpenAS2 Server v3.3.0, Server=OpenAS2 Server v3.3.0}
Attributes:{FINAL_RECIPIENT=rfc822; TESTINGOPENAS2, MIC=null, REPORTING_UA=OpenAS2 Server v3.3.0@/172.17.0.2:10080, ORIGINAL_MESSAGE_ID=<test-0094bfad-f6ca-4960-aa31-7c01fffe550d@orderful-Theas-MBP.lan>, ORIGINAL_RECIPIENT=rfc822; TESTINGOPENAS2, DISPOSITION=automatic-action/MDN-sent-automatically; processed/Error:decryption-failed}

I can't find any documentation or further logs indicating what might be causing this.

igwtech commented 2 years ago

Usually this type of error is related to the AS2 certificates not matching. I would suggest increase the verbosity of your log files to TRACE level using the properties files. Also include your XML config and partnership files to help you track the issue.

On Mon, Sep 26, 2022, 7:12 PM Piers MacDonald @.***> wrote:

Howdy, I'm trying to figure out some compatibility issues with an OpenAS2 server and get a failed MDN that says automatic-action/MDN-sent-automatically; processed/Error:decryption-failed

Trying to reproduce in OpenAS2 the response verbose logs show this:

022-09-26 23:01:54.207 ERROR OpenAS2Exception: Error occurred:: Malformed content.

Sources: {message=Message From:{as2_id=TESTPI, name=PartnerA, ***@***.***, x509_alias=partnera}To:{as2_id=TESTINGOPENAS2, name=MyCompany, ***@***.***, x509_alias=mycompany}

Headers:{Content-Type=application/pkcs7-mime; smime-type=enveloped-data;

name=smime.p7m, Accept=application/json, text/plain, /, @.***>, As2-From=TESTPI, As2-To=TESTINGOPENAS2, As2-Version=1.0, Disposition-Notification-To=TESTPI, Disposition-Notification-Options=signed-receipt-protocol=required,pkcs7-signature; signed-receipt-micalg=required,sha-256, Content-Transfer-Encoding=base64, Content-Disposition=null, Date=Mon, 26 Sep 2022 23:01:53 +0000, MIME-Version=1.0, User-Agent=axios/0.21.4, Content-Length=5576, x-datadog-trace-id=8025217437283227534, x-datadog-parent-id=3382581270929917396, x-datadog-sampling-priority=1, x-datadog-tags=_dd.p.upstream_services=QG5yd2wvbm9kZQ==|1|0|1, Host=localhost:4080, Connection=keep-alive}

Attributes:{HTTP_REQUEST_TYPE=POST, destination_ip=/172.17.0.2, destination_port=10080, HTTP_REQUEST_URL=/, source_port=60210, source_ip=/172.17.0.1}

MDN:MDN From:{as2_id=TESTINGOPENAS2, name=MyCompany, @., x509_alias=mycompany}To:{as2_id=TESTPI, name=PartnerA, @., x509_alias=partnera}

Headers:{Date=Mon, 26 Sep 2022 23:01:54 +0000, @., @._TESTINGOPENAS2>, Subject=Your Requested MDN Response re: null, MIME-Version=1.0, Content-Type=multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="----=_Part_1_1366489909.1664233314182", AS2-To=TESTPI, AS2-From=TESTINGOPENAS2, AS2-Version=1.1, Connection=close, TE, User-Agent=OpenAS2 Server v3.3.0, Server=OpenAS2 Server v3.3.0}

Attributes:{FINAL_RECIPIENT=rfc822; TESTINGOPENAS2, MIC=null, REPORTING_UA=OpenAS2 Server v3.3.0@/172.17.0.2:10080, @.***>, ORIGINAL_RECIPIENT=rfc822; TESTINGOPENAS2, DISPOSITION=automatic-action/MDN-sent-automatically; processed/Error:decryption-failed}

I can't find any documentation or further logs indicating what might be causing this.

— Reply to this email directly, view it on GitHub https://github.com/OpenAS2/OpenAs2App/issues/299, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2QND7A2D2XLFAFNVPPJ33WAIUVNANCNFSM6AAAAAAQWH6LHQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

uhurusurfa commented 2 years ago

Are you sending/receiving to/from another OpenAS2 server or some other AS2 implementation?

uhurusurfa commented 2 years ago

@piersmacdonald - have you resolved this issue?

piersmacdonald commented 1 year ago

Apologies, I lost this update in a flurry of Github notifications. Been working with a colleague @benpetermorris on this. I believe he's also reached out so I'll close this issue to not duplicate.

As as aside: we're finding lots of edge cases with AS2 implementation. Is there a strong community you know of online to discuss the protocol more generally?

uhurusurfa commented 1 year ago

I have no knowledge of an AS2 community and all of the OpenAS2 implementation is based entirely on interpretation of the IETF 4130 specification for AS2.