abhishek-ram / pyas2

This repo is no longer maintained and has been moved to https://github.com/abhishek-ram/django-pyas2
GNU General Public License v2.0
47 stars 23 forks source link

Sending message between two PYAS2 server #44

Closed iversa closed 6 years ago

iversa commented 6 years ago

I have setup two PYAS2 servers and trying to send a message between the two I followed the instructions here in this Quick Start Guide http://pyas2.readthedocs.io/en/latest/quick-start-guide.html#

I can't get it to work. When trying to send a file this is how far it gets

I checked the logs for both the application and server. Application log only shows the Send message started with parameters: {parameters} and the server log is empty

I see that logging is set to INFO. Where can I change the log level of the application?

Here is the screenshot ayas2 send message

abhishek-ram commented 6 years ago

It is strange that no error is logged, you can change the log level using the settings as described here http://pyas2.readthedocs.io/en/latest/configuration.html

iversa commented 6 years ago

I did that changing it to DEBUG and here is what I have in the pyas2.log file

20180115 11:15:09 INFO     : Re-send message started with parameters: "['c:\\python27\\python.exe', 'C:\\Python27\\Scripts\\django_pyas2\\manage.py', 'sendas2message', u'TelegraphRoadAS2', u'iversaas2', u'c:\\users\\admini~1\\appdata\\local\\temp\\2\\tmp7eeemk_tmp1hwedo_tmpdhbx6w_tmphelkch_850 sample with envelop info.x12']"
20180115 11:15:10 DEBUG    : Compressed message 151603291022.3720.9542029485780806733@WIN-82EFMFFL642.ec2.internal payload as:
MIME-Version: 1.0
Content-Type: application/pkcs7-mime; name="smime.p7z";
 smime-type="compressed-data"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7z"

MIAGCyqGSIb3DQEJEAEJoIAwgAIBADCABgsqhkiG9w0BCRADCAAAMIAGCSqGSIb3DQEHAaCABIIF
e3ic7Zpbb9s2FMffC/Q7EMUeNmJJedVlw4bKEuMosSVXlzTpS6HGam00tgxbXZqXfvYd6hLHEpAO
GDa/SEBsieQ5JM3zw+FfjFusy3xdniQPm/w3lG02d8vbrFwW69f5fHlyW6x3UPvyhds085a7TbFb
6gbQuiyz28UKyn9Hn5Z3+Tpb5X+8KlcbM8/z1ZcPcEcX9/m80Hfzxcdvxr2+W+R3X24XH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c6L/7eo8C4qsoeK
0Uel2XmJAZUBlWdQmYZBAj95Z/NF280XREidUSLfG6uGk0cbnVAgfJnb1SdAms0tmxHzeAnF6FFi
9impd13EHigZKPnRWy91chbedDhpt16ccY7eOUmbSp4IeHqNxLvujksLeGlQZh4RELMHiNUHxKoB
MQdABkCeASSJQj9Gka/fYam4A4m1TyYEggLaKTecQBTHDS2V9QlY19uxChvbQcZFFxvYfRk2N6Ww
joeN1cPG7mEDEqXCRg7YDNg8gw2ojTgGpX4IDKMNMLbgpD5JSZzYBXWyP0p5tNRKRVwj1k8x+hhF
WPBxPFbsLiv1WeQhK3JIMQMr/yDFqChSozAIOqKetVrFMkklZ5SqkswMVj6AdPSYZPb2mhnjCtGg
q+7122JpimOeq/RP62n/tJ6ZtbofdMvAzLPq3okgbSAX1jrqanxmNtxQQmUl8r300KAB50DuiwDR
i+4hC8h9blHKJD0eNr0Te9o/sWfW8FJswObH2MxCLfeRnlLUzTatmJEmofpYEqSPE8SuEzieryC5
NNDULk4aF5ocO0J01P1fF33ywgwOqmZPzv/8Ohnq/gaVNTzWAAAAAAAAAAAAAA==
abhishek-ram commented 6 years ago

There is not much here is that all, try disabling compression and see what happens?

iversa commented 6 years ago

You mean compression under the partner > security settings? I did that and then nothing happens

All I have the debug log then is this

20180115 12:02:53 INFO : Re-send message started with parameters: "['c:\\python27\\python.exe', 'C:\\Python27\\Scripts\\django_pyas2\\manage.py', 'sendas2message', u'TelegraphRoadAS2', u'iversaas2', u'c:\\users\\admini~1\\appdata\\local\\temp\\2\\tmplx10ch_tmp7eeemk_tmp1hwedo_tmpdhbx6w_tmphelkch_850 sample with envelop info.x12']"

It is at this step Signing the message using organization key as2_private.pem

iversa commented 6 years ago

I think it was an issue with the first ssl keys that I created. I did them again but now I get this error

Still appears to be a ssl key issue but I'm not sure what to do

20180115 13:53:26 ERROR : Failed to send message, error: Traceback (most recent call last): File "c:\python27\lib\site-packages\pyas2\management\commands\sendas2message.py", line 72, in handle payload = as2lib.build_message(message) File "c:\python27\lib\site-packages\pyas2\as2lib.py", line 375, in build_message str(message.organization.signature_key.certificate.path), AttributeError: 'NoneType' object has no attribute 'certificate'

abhishek-ram commented 6 years ago

Looks like signature key has not been set in either the organization or the partner. Please check your setup.

iversa commented 6 years ago

That was the issue on my last try but when I set it I'm back at this

20180115 11:15:09 INFO     : Re-send message started with parameters: "['c:\\python27\\python.exe', 'C:\\Python27\\Scripts\\django_pyas2\\manage.py', 'sendas2message', u'TelegraphRoadAS2', u'iversaas2', u'c:\\users\\admini~1\\appdata\\local\\temp\\2\\tmp7eeemk_tmp1hwedo_tmpdhbx6w_tmphelkch_850 sample with envelop info.x12']"
20180115 11:15:10 DEBUG    : Compressed message 151603291022.3720.9542029485780806733@WIN-82EFMFFL642.ec2.internal payload as:
MIME-Version: 1.0
Content-Type: application/pkcs7-mime; name="smime.p7z";
 smime-type="compressed-data"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7z"

MIAGCyqGSIb3DQEJEAEJoIAwgAIBADCABgsqhkiG9w0BCRADCAAAMIAGCSqGSIb3DQEHAaCABIIF
e3ic7Zpbb9s2FMffC/Q7EMUeNmJJedVlw4bKEuMosSVXlzTpS6HGam00tgxbXZqXfvYd6hLHEpAO
GDa/SEBsieQ5JM3zw+FfjFusy3xdniQPm/w3lG02d8vbrFwW69f5fHlyW6x3UPvyhds085a7TbFb
6gbQuiyz28UKyn9Hn5Z3+Tpb5X+8KlcbM8/z1ZcPcEcX9/m80Hfzxcdvxr2+W+R3X24XHyxJ0C5b
be5ydL8sFyhf/5XfFRu0XH8qTr9R9urli5cv3oxjPAsxE1JalmELbBkGlxyeKGaEmsRiEhOLc2zD
zTUmRBBKvmtTP3bgEaPHq/tE926bIsqe+G+KnnSR1u7hU1+6Q4Jn+M/v/2KYb+IEww+hi8El1SUj
NdYjrUYvCdOmjBr40Y9uE6kzfBXpgZgEeiKkLfRmmBvYDePEDZGnZk6UTFWQtNXUxq7bVkdq7IdB
W/X+Pa584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Rg7YDNg8gw2ojTgGpX4IDKMNMLbgpD5JSZzYBXWyP0p5tNRKRVwj1k8x+hhF
WPBxPFbsLiv1WeQhK3JIMQMr/yDFqChSozAIOqKetVrFMkklZ5SqkswMVj6AdPSYZPb2mhnjCtGg
q+7122JpimOeq/RP62n/tJ6ZtbofdMvAzLPq3okgbSAX1jrqanxmNtxQQmUl8r300KAB50DuiwDR
i+4hC8h9blHKJD0eNr0Te9o/sWfW8FJswObH2MxCLfeRnlLUzTatmJEmofpYEqSPE8SuEzieryC5
NNDULk4aF5ocO0J01P1fF33ywgwOqmZPzv/8Ohnq/gaVNTzWAAAAAAAAAAAAAA==
abhishek-ram commented 6 years ago

I need to take a look at this message me on skype at abhishek.ram2

iversa commented 6 years ago

I have sent you a Skype invite

dtstbnow commented 6 years ago

Has there been any progress on this? I am experiencing the same issues, it appears to be happening during the signer.sign call in sign_payload.

abhishek-ram commented 6 years ago

pyAS2 is currently not supported on windows as there are issues installing the dependant library M2Crypto

dtstbnow commented 6 years ago

I encountered this on Debian per M2Crypto's recommended installation instructions.