phax / as2-server

A standalone Java AS2 server - see as2-lib for the generic parts
Other
29 stars 8 forks source link

Meaning of <attribute name="content_transfer_encoding" value="binary"/> #15

Closed mreinigjr closed 9 years ago

mreinigjr commented 9 years ago

Hi Philip,

Can you please elaborate on the meaning of the following line in the partnership.xml file:

<attribute name="content_transfer_encoding" value="binary"/>

I am particularly interested in other possible values as well as if we need to set this when receiving messages. I am currently having issues with receiving readable messages from my AS2 partner. They are sending messages in base64. I will send you the actual message via email.

Thanks, Michael

phax commented 9 years ago

Hi Michael. There is an enum EContentTransferEncoding in as2-lib which provides the default values. Dont know how this is handled internally... Will investigate. // Philip

Am 27. August 2015 15:19:09 MESZ, schrieb Michael Reinig notifications@github.com:

Hi Philip,

Can you please elaborate on the meaning of the following line in the partnership.xml file:

<attribute name="content_transfer_encoding" value="binary"/>

I am particularly interested in other possible values as well as if we need to set this when receiving messages. I am currently having issues with receiving readable messages from my AS2 partner. They are sending messages in base64. I will send you the actual message via email.

Thanks, Michael


Reply to this email directly or view it on GitHub: https://github.com/phax/as2-server/issues/15

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

mreinigjr commented 9 years ago

Hi Philip,

Thanks. I just sent you more details. I will be busy for a lot of the Morning (my time) but I will check back as soon as I can to provide you with more info should you need it.

Thanks, Michael

phax commented 9 years ago

Hi Michael!

I think I found a place where the Content-Transfer-Encoding header was missing. I fixed this in the master branch, so can you please update and check again.

Thanks, Philip

mreinigjr commented 9 years ago

Hi Philip,

Happy Friday. I finally got a chance to test this with no success. Do I need to set what the incoming message encoding is in partnership.xml? I just did a test without specifying anything for the incoming message with my partner and the message is still coming in the same.

Thanks, Michael

phax commented 9 years ago

Hi Michael!

Setting this in the partnerhsip does not really make sense :) The goal is to handle what's coming in, in the best possible way. So I think it must be a technical issue with the MimeBodayPart handling. I have an idea but don't know whether I have the time to test this on the weekend - otherways on Monday (the idea to change the order of setting headers and content upon receive).

Happy weekend, Philip

mreinigjr commented 9 years ago

Hi Philip,

Thanks! No worries. My contact at my trading partner is not in over the weekend anyway, so I wouldn't be able to resume testing until Monday anyway.

I have a pyas2 saved vm image, so I will probably spin that up and see if I can communicate with that system. I could probably provide additional msg header data, mdn info, etc... to help.

I hope you have a nice weekend as well, Michael

phax commented 9 years ago

Hi Michael!

I added some lines of code that explicitly deal with the "base64" and "quoted-printable" encodings. Therefore you should not be able to receive the messages without problem!

Please give me some feedback how it went.

Thanks, Philip

mreinigjr commented 9 years ago

Hi Philip,

I am still getting the same issue. What are you decoding the base64 text to? Base64?

Thanks, Michael

mreinigjr commented 9 years ago

Also, I only did a pull, then an mvn clean install on as2-lib, then I did a complete new build of as2-server using mvn clean install -Pwithdep. I am then using the standalone version to test with. Do you see any of this as a problem for these new commits to take affect? I deleted the standalone folder before doing the build again.

Thanks, Michael

phax commented 9 years ago

No, this sounds reasonable. The change is in as2-lib class HTTPHelper line 283ff

mreinigjr commented 9 years ago

here are the info logs:

[2015-08-31T13:11:25,351] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] Incoming connection 127.0.0.1:47666 -- com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler.handle(AS2ReceiverHandler.java:490)
[2015-08-31T13:11:25,368] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] received 1616 bytes in 0.013 seconds at 121.404 KBps from 127.0.0.1:47666 [<7871488.2015-08-31.12.11.24@u7Pqup3njo54pU/YcIMOF1Yg3ks=>] -- com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler.handle(AS2ReceiverHandler.java:517)
[2015-08-31T13:11:25,384] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored message to /home/mreinigjr/as2-server/data/inbox/partneredi-mepartneras2-<7871488.2015-08-31.12.11.24@u7Pqup3njo54pU/YcIMOF1Yg3ks=_ [<7871488.2015-08-31.12.11.24@u7Pqup3njo54pU/YcIMOF1Yg3ks=>] -- com.helger.as2lib.processor.storage.MessageFileModule.handle(MessageFileModule.java:85)
[2015-08-31T13:11:25,390] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored headers to /home/mreinigjr/as2-server/data/inbox/msgheaders/2015/08/partneredi-mepartneras2-<7871488.2015-08-31.12.11.24@u7Pqup3njo54pU/YcIMOF1Yg3ks=_ [<7871488.2015-08-31.12.11.24@u7Pqup3njo54pU/YcIMOF1Yg3ks=>] -- com.helger.as2lib.processor.storage.MessageFileModule.handle(MessageFileModule.java:103)
[2015-08-31T13:11:25,404] [AS2-SERVER] [WARN ] [AS2ConnectionThread-AS2ReceiverModule] Failed to split disposition options parameter '' into attribute and values -- com.helger.as2lib.disposition.DispositionOptions.createFromString(DispositionOptions.java:422)
[2015-08-31T13:11:25,441] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored MDN to /home/mreinigjr/as2-server/data/mdn/2015/08/partneredi-mepartneras2-<7871488.2015-08-31.12.11.24@u7Pqup3njo54pU/YcIMOF1Yg3ks=_ -- com.helger.as2lib.processor.storage.MDNFileModule.handle(MDNFileModule.java:84)
[2015-08-31T13:11:25,441] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] sent MDN [automatic-action/MDN-sent-automatically; processed] 127.0.0.1:47666 [<7871488.2015-08-31.12.11.24@u7Pqup3njo54pU/YcIMOF1Yg3ks=>] -- com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler.sendMDN(AS2ReceiverHandler.java:265)
[2015-08-31T13:11:25,462] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] AS2ConnectionThread: done running -- com.helger.as2lib.processor.receiver.AbstractNetModule$ConnectionThread.run(AbstractNetModule.java:240)

What about line:

[2015-08-31T13:11:25,404] [AS2-SERVER] [WARN ] [AS2ConnectionThread-AS2ReceiverModule] Failed to split disposition options parameter '' into attribute and values -- com.helger.as2lib.disposition.DispositionOptions.createFromString(DispositionOptions.java:422)

mreinigjr commented 9 years ago

Are you logging what the incoming encoding is anywhere?

mreinigjr commented 9 years ago

I don't have debug on because the directory polling output can really fill a file up and my partner can sometimes take several hours before sending a test message.

phax commented 9 years ago

I now added logging if the special transfer encodings are used (in as2-lib). Need to leave the office now - sorry. "Talk" to you later.

mreinigjr commented 9 years ago

Hi Philip,

No problem. Thanks. I will keep posting stuff as I find things out.

Have a nice evening, Michael

phax commented 9 years ago

Do you see the new log msg?

Am 31. August 2015 20:08:45 MESZ, schrieb Michael Reinig notifications@github.com:

Hi Philip,

No problem. Thanks. I will keep posting stuff as I find things out.

Have a nice evening, Michael


Reply to this email directly or view it on GitHub: https://github.com/phax/as2-server/issues/15#issuecomment-136449339

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

mreinigjr commented 9 years ago

Not yet, waiting on my partner to send a new message.

mreinigjr commented 9 years ago

Hi Philip,

So I spun up a version of pyas2 (as2 software that only supports sha256 signing) and I was able to successfully send a message to as2-server. Here are the message headers pyas2 sent:

Headers:
Host: localhost:10080
Connection: close
Content-Length: 4015
disposition-notification-to: m@test.com
disposition-notification-options: signed-receipt-protocol=required, pkcs7-signature; signed-receipt-micalg=optional, sha1
AS2-From: testing
Accept-Encoding: gzip, deflate
Content-Disposition: attachment; filename="test.txtGz7n57"
Content-Transfer-Encoding: base64
recipient-address: http://as2.test.com/incoming
Subject: EDI Message sent using pyas2
Accept: */*
user-agent: PYAS2, A pythonic AS2 server
AS2-Version: 1.2
AS2-To: mepartneras2
Date: Mon, 31 Aug 2015 14:44:10 -0500
Message-ID: <20150831194410.1682.94489@ME-PYAS2-TEST>
Content-Type: application/edi-consent
ediint-features: CEM
MIME-Version: 1.0

Attributes:
source_ip: /127.0.0.1
source_port: 47690
destination_ip: /127.0.0.1
destination_port: 10080
as2msg.received: true
HTTP_REQUEST_TYPE: POST
HTTP_REQUEST_URL: /HttpReciver
HTTP_REQUEST_VERSION: HTTP/1.0
as2msg.received.encrypted: true
as2msg.received.signed: true

msg headers as2-server received:

Headers:
Host: localhost:10080
Connection: close
Content-Length: 4015
disposition-notification-to: m@me.com
disposition-notification-options: signed-receipt-protocol=required, pkcs7-signature; signed-receipt-micalg=optional, sha1
AS2-From: metesting
Accept-Encoding: gzip, deflate
Content-Disposition: attachment; filename="test.txtGz7n57"
Content-Transfer-Encoding: base64
recipient-address: http://as2.me.com/incoming
Subject: EDI Message sent using pyas2
Accept: */*
user-agent: PYAS2, A pythonic AS2 server
AS2-Version: 1.2
AS2-To: mepartneras2
Date: Mon, 31 Aug 2015 14:44:10 -0500
Message-ID: <20150831194410.1682.94489@ME-PYAS2-TEST>
Content-Type: application/edi-consent
ediint-features: CEM
MIME-Version: 1.0

Attributes:
source_ip: /127.0.0.1
source_port: 47690
destination_ip: /127.0.0.1
destination_port: 10080
as2msg.received: true
HTTP_REQUEST_TYPE: POST
HTTP_REQUEST_URL: /HttpReciver
HTTP_REQUEST_VERSION: HTTP/1.0
as2msg.received.encrypted: true
as2msg.received.signed: true

as2-server headers sent with mdn:

Headers:
Date: Mon, 31 Aug 2015 15:44:10 -0400
From: m@me.com
Message-ID: <ph-OpenAS2-31082015154410-0400-9908@mepartneras2_metesting>
Subject: Your Requested MDN Response
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-1; 
    boundary="----=_Part_8_1347065500.1441050250546"
AS2-To: metesting
AS2-From: mepartneras2
AS2-Version: 1.1
Server: ph-OpenAS2 v1.0
Content-Length: 3774

Attributes:
REPORTING_UA: ph-OpenAS2 v1.0@/127.0.0.1:10080
ORIGINAL_RECIPIENT: rfc822; mepartneras2
FINAL_RECIPIENT: rfc822; mepartneras2
ORIGINAL_MESSAGE_ID: <20150831194410.1682.94489@ME-PYAS2-TEST>
DISPOSITION: automatic-action/MDN-sent-automatically; processed
MIC: hL7CsF8tMK4ZZ9G1PdtihfRycNw=, sha1
Text:
The message sent to Recipient mepartneras2 on Mon, 31 Aug 2015 14:44:10 -0500 with Subject EDI Message sent using pyas2 has been received, the EDI Interchange was successfully decrypted and it's integrity was verified. In addition, the sender of the message, Sender metesting at Location /127.0.0.1 was authenticated as the originator of the message. There is no guarantee however that the EDI Interchange was syntactically correct, or was received by the EDI application/translator.

Here are the logs associated with this message:

[2015-08-31T15:44:10,463] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] Incoming connection 127.0.0.1:47690 -- com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler.handle(AS2ReceiverHandler.java:490)
[2015-08-31T15:44:10,468] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] Incoming message uses Content-Transfer-Encoding 'base64' - decoding -- com.helger.as2lib.util.http.HTTPHelper.readHttpPayload(HTTPHelper.java:293)
[2015-08-31T15:44:10,474] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] received 2963 bytes in 0.006 seconds at 482.265 KBps from 127.0.0.1:47690 [<20150831194410.1682.94489@ME-PYAS2-TEST>] -- com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler.handle(AS2ReceiverHandler.java:517)
[2015-08-31T15:44:10,531] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored message to /home/mreinigjr/as2-server/data/inbox/partner-me-_20150831194410.1682.94489@ME-PYAS2-TEST_ [<20150831194410.1682.94489@ME-PYAS2-TEST>] -- com.helger.as2lib.processor.storage.MessageFileModule.handle(MessageFileModule.java:85)
[2015-08-31T15:44:10,537] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored headers to /home/mreinigjr/as2-server/data/inbox/msgheaders/2015/08/partner-me-_20150831194410.1682.94489@ME-PYAS2-TEST_ [<20150831194410.1682.94489@ME-PYAS2-TEST>] -- com.helger.as2lib.processor.storage.MessageFileModule.handle(MessageFileModule.java:103)
[2015-08-31T15:44:10,588] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored MDN to /home/mreinigjr/as2-server/data/mdn/2015/08/partner-me-_20150831194410.1682.94489@ME-PYAS2-TEST_ -- com.helger.as2lib.processor.storage.MDNFileModule.handle(MDNFileModule.java:84)
[2015-08-31T15:44:10,588] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] sent MDN [automatic-action/MDN-sent-automatically; processed] 127.0.0.1:47690 [<20150831194410.1682.94489@ME-PYAS2-TEST>] -- com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler.sendMDN(AS2ReceiverHandler.java:265)
[2015-08-31T15:44:10,588] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] AS2ConnectionThread: done running -- com.helger.as2lib.processor.receiver.AbstractNetModule$ConnectionThread.run(AbstractNetModule.java:240)

I just received a message from my trading partner, and here are the msg headers they sent:

Headers:
Host: localhost:10080
Connection: close
Content-Length: 1616
AS2-To: mepartneras2
AS2-From: partneredi
AS2-Version: 1.1
Date: Mon, 31 Aug 2015  14:53:23 -0500
Message-ID: <7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=>
Disposition-Notification-To: http://bpsedi.partner.com:4080
Disposition-notification-options: signed-receipt-protocol=optional, pkcs7-signature;
Content-Type: application/pkcs7-mime

Attributes:
source_ip: /127.0.0.1
source_port: 47691
destination_ip: /127.0.0.1
destination_port: 10080
as2msg.received: true
HTTP_REQUEST_TYPE: POST
HTTP_REQUEST_URL: /HttpReciver
HTTP_REQUEST_VERSION: HTTP/1.0

as2-server mdn headers sent:

Headers:
Date: Mon, 31 Aug 2015 15:53:23 -0400
From: m@me.com
Message-ID: <ph-OpenAS2-31082015155323-0400-7213@mepartneras2_partneredi>
Subject: Your Requested MDN Response
Mime-Version: 1.0
Content-Type: multipart/report; report-type=disposition-notification; 
    boundary="----=_Part_9_704682651.1441050803367"
AS2-To: partneredi
AS2-From: mepartneras2
AS2-Version: 1.1
Server: ph-OpenAS2 v1.0
Content-Length: 944

Attributes:
REPORTING_UA: ph-OpenAS2 v1.0@/127.0.0.1:10080
ORIGINAL_RECIPIENT: rfc822; mepartneras2
FINAL_RECIPIENT: rfc822; mepartneras2
ORIGINAL_MESSAGE_ID: <7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=>
DISPOSITION: automatic-action/MDN-sent-automatically; processed
Text:
The message sent to Recipient mepartneras2 on Mon, 31 Aug 2015  14:53:23 -0500 with Subject null has been received, the EDI Interchange was successfully decrypted and it's integrity was verified. In addition, the sender of the message, Sender partneredi at Location /127.0.0.1 was authenticated as the originator of the message. There is no guarantee however that the EDI Interchange was syntactically correct, or was received by the EDI application/translator.

and here are the info logs:

[2015-08-31T15:53:23,353] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] received 1616 bytes in 0.0 seconds at 1.592 KBps from 127.0.0.1:47691 [<7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=>] -- com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler.handle(AS2ReceiverHandler.java:517)
[2015-08-31T15:53:23,363] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored message to /home/mreinigjr/as2-server/data/inbox/partneredi-mepartneras2-<7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=_ [<7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=>] -- com.helger.as2lib.processor.storage.MessageFileModule.handle(MessageFileModule.java:85)
[2015-08-31T15:53:23,365] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored headers to /home/mreinigjr/as2-server/data/inbox/msgheaders/2015/08/partneredi-mepartneras2-<7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=_ [<7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=>] -- com.helger.as2lib.processor.storage.MessageFileModule.handle(MessageFileModule.java:103)
[2015-08-31T15:53:23,366] [AS2-SERVER] [WARN ] [AS2ConnectionThread-AS2ReceiverModule] Failed to split disposition options parameter '' into attribute and values -- com.helger.as2lib.disposition.DispositionOptions.createFromString(DispositionOptions.java:422)
[2015-08-31T15:53:23,382] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] stored MDN to /home/mreinigjr/as2-server/data/mdn/2015/08/partneredi-mepartneras2-<7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=_ -- com.helger.as2lib.processor.storage.MDNFileModule.handle(MDNFileModule.java:84)
[2015-08-31T15:53:23,382] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] sent MDN [automatic-action/MDN-sent-automatically; processed] 127.0.0.1:47691 [<7872594.2015-08-31.14.53.23@u7Pqup3njo54pU/YcIMOF1Yg3ks=>] -- com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler.sendMDN(AS2ReceiverHandler.java:265)
[2015-08-31T15:53:23,383] [AS2-SERVER] [INFO ] [AS2ConnectionThread-AS2ReceiverModule] AS2ConnectionThread: done running -- com.helger.as2lib.processor.receiver.AbstractNetModule$ConnectionThread.run(AbstractNetModule.java:240)

It looks like my trading partner is not setting/specifying the transfer-encoding or the signing algorithm. Do you agree?

Do you think we could default to base64 when the transfer header is not set or look in the partnership.xml file?

Are you already defaulting to sha1 if the signing algorithm is not specified?

I am discussing this with my partner now.

By the way, I tested receiving compressed messages and it worked fine. You can see in the pyas2 headers what compression types are supported. I will hit this harder soon.

Thanks, Michael

mreinigjr commented 9 years ago

Also, I am noticing pyas2 is specifying as2 version 1.2 and as2-server is specifying as2 version 1.1. What is the difference? Do you see this as causing issues?

UPDATE: I just noticed that my partner is using version 1.1, so I doubt this is causing issues there, but I wonder if it would cause issues with other partners.

Thanks, Michael

mreinigjr commented 9 years ago

Hi Philip,

Looks like my partner is defaulting to base64 and sha1. Since in the header above, they are specifying that they want a signed MDN back (they don't say how they want it signed, just that they wanted it signed) through the use of the following headers as specified in rfc 4130:

page 10 of rfc 4130.

MDN over HTTP, signature
      -RFC2616/2045
        -RFC1847 (multipart/signed)
         -RFC3798 (message/disposition-notification)
         -RFC3851 (application/pkcs7-signature)

So I think sha1 and base64 are considered default values in these cases. RFC 4130 is not clear on (or I have not found it) what the defaults should be, but they do specifically mention base64 in other cases such as when dealing with the MIC.

Thoughts?

Michael

mreinigjr commented 9 years ago

Okay, so this is interesting on page 11 of rfc 4130:

5.2.1.  Content-Transfer-Encoding Not Used in HTTP Transport

   HTTP can handle binary data and so there is no need to use the
   content transfer encodings of MIME [1].  This difference is discussed
   in [3], Section 19.4.5.  However, a content transfer encoding value
   of binary or 8-bit is permissible but not required.  The absence of
   this header MUST NOT result in transaction failure.  Content transfer
   encoding of MIME bodyparts within the AS2 message body is also
   allowed.

Perhaps I should just ask my partner to use binary. Do you think this better? What if we could override or set a default in the partnership.xml file?

klaasfeenstra commented 9 years ago

Hello,

Just to inform that I had also a problem with business partners that were using RssBus AS2 server. I have contact them and in the newest version the problem with MDN signing is solved. Rssbus is using code from N-software. (and they are Drummond Certified....)

My partner changed from code64 to the standard binary.

Kind regards,

Klaas

On Tue, Sep 1, 2015 at 2:27 AM, Michael Reinig notifications@github.com wrote:

Okay, so this is interesting on page 11 of rfc 4130:

5.2.1. Content-Transfer-Encoding Not Used in HTTP Transport

HTTP can handle binary data and so there is no need to use the content transfer encodings of MIME [1]. This difference is discussed in [3], Section 19.4.5. However, a content transfer encoding value of binary or 8-bit is permissible but not required. The absence of this header MUST NOT result in transaction failure. Content transfer encoding of MIME bodyparts within the AS2 message body is also allowed.

Perhaps I should just ask my partner to use binary. Do you think this better? What if we could override or set a default in the partnership.xml file?

— Reply to this email directly or view it on GitHub https://github.com/phax/as2-server/issues/15#issuecomment-136536435.

phax commented 9 years ago

Hi Klaas!

Thanks for pointing that out. Nevertheless I will see whether it is possible to create a default for that. There are too many different software versions out there...

Michael: asking your business partner to switch to binary or 8bit as the default is of course the quickest solution!

Thanks, Philip

phax commented 9 years ago

Hi Michael!

Concerning the version:

Concerning the dispotion-notification-options: according to the RFC4130 the following is the truth (end of page 22, section 7.3):

Both the "signed-receipt-protocol" and the "signed-receipt-micalg" option
parameters are REQUIRED when requesting a signed receipt.

Therefore your partner is not RFC compliant and I think it makes no sense to provide a default value for this!

I digged a bit into the Content-Transfer-Encoding issue but failed to find anything reasonable that helps you. The simplest thing as said above is to change it on the side of your business partner.

// Philip

mreinigjr commented 9 years ago

Hi Philip,

I just received a message from my partner after requesting the message be sent as binary and still no success. Apart from the Disposition-notification-options issue I pointed out earlier, I am now noticing that my partner has set:

Content-Type: application/pkcs7-mime

Where in pyas2 message from above:

Content-Type: application/edi-consent

Would this cause issues when interpreting the content of the message? Again, I received the pyas2 message no problem.

Thanks, Michael

phax commented 9 years ago

Can you please post the headers of the binary message - thanks.

Concerning the content type: I'm not sure what "application/edi-consent" exactly is, but I guess that this is a feature of AS2 1.2 (see above). The "application/pkcs7-mime" is the correct content type for AS2 1.0 and 1.1.

Update: nope has nothing to do with it. edi-consent is defined in https://tools.ietf.org/html/rfc1767

mreinigjr commented 9 years ago

Thanks Philip! Here are the received headers:

Headers:
Host: localhost:10080
Connection: close
Content-Length: 1616
AS2-To: mepartneras2
AS2-From: partneredi
AS2-Version: 1.1
Date: Tue, 01 Sep 2015  11:48:58 -0500
Message-ID: <7876365.2015-09-01.11.48.58@u7Pqup3njo54pU/YcIMOF1Yg3ks=>
Disposition-Notification-To: http://bpsedi.partner.com:4080
Disposition-notification-options: signed-receipt-protocol=optional, pkcs7-signature;
Content-Type: application/pkcs7-mime

Attributes:
source_ip: /127.0.0.1
source_port: 47720
destination_ip: /127.0.0.1
destination_port: 10080
as2msg.received: true
HTTP_REQUEST_TYPE: POST
HTTP_REQUEST_URL: /HttpReciver
HTTP_REQUEST_VERSION: HTTP/1.0
phax commented 9 years ago

Are you sure it is binary? The content length is identical to the previous one... (1616)

mreinigjr commented 9 years ago

I am not sure. I am just going off of what they told me.

mreinigjr commented 9 years ago

Is there someway that I can analyze the file that you know of? I have been trying to convert the file in all manor of ways (old files I have received and recent) but nothing seems to get readable text. My partner is supposed to be setting the content type to EDI, so I have asked them to try TEXT. This is an image of the interface they are using. Very old software.

image002

phax commented 9 years ago

Oh dear lord :) He should try the Encoding Method *BINARY or *8BIT or *7BIT

mreinigjr commented 9 years ago

Right, that is what they tried. They tried *BINARY and it didn't work. Very old...I know. :)

phax commented 9 years ago

Do they have a handbook for this? They should try the *8BIT

phax commented 9 years ago

Or any product name to google for?

mreinigjr commented 9 years ago

That is what I suggested a few minutes ago. Great idea. :)

I think the manual has fossilized and now the text is unreadable. :)

I just did a test message with Mendelson without setting the "Content-Transfer-Encoding". Looks like as2-lib defaults to 8bit. So now I am every hopeful.

The software is called TrailBlazer and was/is owned by liaison. I will verify this. I have tried searching for stuff, but nothing. There is actually an old post on the OpenAS2 forum about issues with this software, but that was awhile ago.

mreinigjr commented 9 years ago

here is the openas2 post I was referring to:

http://sourceforge.net/p/openas2/discussion/272857/thread/f9e5ef7f/

mreinigjr commented 9 years ago

Actually, after reading through this post again, I think you already fixed this issue. :)

phax commented 9 years ago

This trailblazer: https://www.gartner.com/doc/492755/nubridges-users-second-chance ??

Anyway there is an iSoft trailblazer and trailblazer systems ;-)

And yes, I think the issue you mentioned was fixed :)

phax commented 9 years ago

So I guess *8BIT did not work either... - maybe there is an F1 help available :smiley:

mreinigjr commented 9 years ago

Okay, that makes sense. I do remember my partner mentioning that the software has changed company ownership. I will keep you posted on the test with *8BIT.

Haha! When I received that image I was amazed, but hey, if it ain't broke don't fix it. :)

It will probably be a few hours before they do send a test message.

phax commented 9 years ago

Or what if they leave the field empty???

mreinigjr commented 9 years ago

Hey! Now that is an idea. I will suggest that if *8BIT does not work. Thanks!

mreinigjr commented 9 years ago

Hi Philip,

So still not working. I just found out that my partner is not sending the message as an attachment. Do you see this as an issue? Based on what the message should be and what I am receiving, I am definitely getting more than just the AS2 message so it may be that the text in the message is not being handled correctly by as2-lib. What do you think? I will send the message and what the actual message should be shortly.

Thanks, Michael

mreinigjr commented 9 years ago

Also, just to recap, this is what we tried. In all cases, the Content-Transfer-Encoding was not set nor was the Disposition-notification-options when receiving messages from my partner.

  1. Encoded binary
  2. Encoded 8bit
  3. Left encoding blank.

Something interesting I just remembered. When I was struggling with getting my partner to work with just receiving messages, the only way the message would complete correctly was when I set <attribute name="sign" value="sha1"/> when receiving messages from my partner. I of course tried using <attribute name="content_transfer_encoding" value="binary"/> in the same xml block, but I was not so lucky.

Thanks, Michael

phax commented 9 years ago

Hi Michael!

I added support for a new system property called "AS2.httpDumpDirectory" which allows to specify a directory where all incoming traffic is stored to. The value of the property must be an absolute directory.

The usage is like the secureRandom system property: -DAS2.httpDumpDirectory=/log/as2/http

Concerning the Content-Transfer-Encoding property in the partnerships: this is used to specify the CTE for outgoing messages but not for incoming messages. Instead I added attribute called content_transfer_encoding_receive which is only valued in incoming messages. Add this to your partnership with the value of base64 and try again.

Btw. because the whole lot of changes, the version number changed to "2.2.0-SNAPSHOT" if this matters to you.

BR, Philip

mreinigjr commented 9 years ago

Hi Philip,

Thank you very much! I will update and let you know how the test goes. In regards to messages embedded in the AS2 message vs. as an attachment, do you see any issues with this?

Michael

phax commented 9 years ago

I'm lacking experience with this and am not quite sure how this will look like. Therefore the HTTP dump would interest me alot :)

mreinigjr commented 9 years ago

Gotcha! I will have my partner send the message as an attachment and send you the dump.

Michael

phax commented 9 years ago

To check if the dumper is active, check your log for an "info" line like this: Using directory XXX to dump all incoming HTTP requests to.

mreinigjr commented 9 years ago

Okay, will do....updating everything now.