Thursday, March 19, 2015

Sending and receving messages with Adroitlogic AS2 Gateway

This post describe how you can use Adroitlogic AS2 Gateway for transferring messages over AS2 Protocol.

To demonstrate this I am using the free and open source AS2 communication software product "mendelson AS2" from mendelson-e-commerce GmbH.

1. First register the AS2 Gateway
2. Create a station. This will act as one end of AS2 stations.
3. Install mendelson

- Download mendelson
- Follow following commands to run mendelson
  >> mkdir mendelson
  >> cd mendelson
  >> unzip /tmp/install_mendelson_opensource_as2_1.1b47.zip
  >> chmod +x *.sh
  >> ./mendelson_as2_start.sh

4. By default there is a partner 'mypartner' created in mendelson, I will change it as 'mendelson' in this demo. And using one of default keys 'key1' in mendelson as keys for this station. First we will see how to send AS2 Messages over http



    
5.  Export the public certificate for 'key1' of partner 'mendelson' from Export-->'Export Certificate(for your trading partner)'


6.Create a partner in AS2 Gateway for mendelson with giving above exported key as 'Partner Certificate' and giving mendelson as 'Trading Partner Name' and 'AS2 Identifier'




7. Create a partner in mendelson to receive messages from AS2 Gateway

steps
- Go to your station in AS2 Gateway and view partner configuration of your station, and download 'Partner Certificate' as Pem or Dem


-  Go to mendelson and add the above certificate to mendelson certificate store 
-  Go to mendelson and create a new partner to receive messages from AS2Gateway
Misc -->Name = AS2 Identifier shown in AS2Gateway partner config
Security --> Partner Certificate(encryption/signature) = certificate you added above
Send --> Receipt URL = Partner URL shown in AS2 Gateway partner config




Now you are ready to send a AS2 message from mendelson station to your station host in AS2 Gateway. You can go to File --> Send to partner and from the pop up, select the partner you set up (adroitlogic.com) and send your message.

Sending AS2 over HTTPS

Similar to above create a partner in mendelson to send over https. For that HTTPS url (https://as2gateway.org:8443/service/as2-receiver ) as the Send -->receipt URL in your mendelson partner

Additionally we need to tell msndelson to trust the certificate of partner from AS2Gateway. For that simply you can type 'https://as2gateway.org:8443/service/as2-receiver ' in your browser and download the certificate and add that certificate in mendelson SSL certificate store.

With that setting you can send AS2 Messages over HTTPS from your mendelson station to partner in AS2Gateway.





No comments:

Post a Comment