Openas2 Server Application
Openas2 Server Application
Openas2 Server Application
Table of Contents
1. Introduction...................................................................................................................................... 2
2. Glossary............................................................................................................................................ 3
3. Installing OpenAS2.......................................................................................................................... 3
3.1. System Requirements............................................................................................................... 3
3.2. Installing Application................................................................................................................3
3.3. Tuning Java............................................................................................................................... 4
4. Configuration Overview................................................................................................................... 5
5. Application Configuration................................................................................................................ 5
5.1. AS2 Message Tracking............................................................................................................. 6
5.2. Overriding Certificate Store Password..................................................................................... 8
5.3. Resend Retry Configuration..................................................................................................... 8
5.4. File Name Parsing.....................................................................................................................9
5.5. Using A Proxy Server............................................................................................................... 9
5.6. Health Check For High Availability Deployment...................................................................10
6. Partner Configuration..................................................................................................................... 11
6.1. Partner Definition....................................................................................................................11
6.2. Partnership Definition............................................................................................................. 11
6.2.1. Signing............................................................................................................................ 12
6.2.2. Encryption....................................................................................................................... 12
6.3. Configuring the AS2 Message ID........................................................................................... 12
6.4. Transfer Encoding...................................................................................................................12
6.5. Supported Encoding Algorithms.............................................................................................12
6.6. Message Compression............................................................................................................ 13
6.7. Custom Mime Headers........................................................................................................... 13
6.7.1. Static Header Values....................................................................................................... 13
6.7.2. Dynamic Header Values From File Name...................................................................... 13
Delimiter Mode................................................................................................................14
Regular Expression Mode................................................................................................15
6.7.3. Adding Custom Headers To HTTP................................................................................. 15
6.8. Setting Dynamic Attributes From File Name......................................................................... 15
7. Certificate Configuration................................................................................................................16
7.1. My Certificates....................................................................................................................... 17
7.1.1. Creating Certificates And Importing Into OpenAS2 Keystore.......................................17
7.1.2. Creating Public Certificate For Sending To Partner........................................................18
7.1.3. Supporting Multiple Certificates.....................................................................................18
7.2. Partner Certificates................................................................................................................. 19
8. Logging System..............................................................................................................................19
8.1. Log Output Targets................................................................................................................. 19
8.1.1. Console Logger............................................................................................................... 19
8.1.2. File Logger...................................................................................................................... 19
8.1.3. Email Logger...................................................................................................................20
8.1.4. Socket Logger................................................................................................................. 20
8.1.5. Sentry Logger..................................................................................................................20
8.2. Log Level Configuration........................................................................................................ 20
8.3. Log Date Format Configuration............................................................................................. 21
9. MDN Configuration....................................................................................................................... 21
9.1. Asynchronous MDN Receiver Configuration.........................................................................22
9.2. Asynchronous MDN Sender Configuration............................................................................22
10. Configuring HTTPS Transport..................................................................................................... 22
10.1. Inbound Transfers................................................................................................................. 22
10.2. Outbound Transfers...............................................................................................................22
11. Running OpenAS2........................................................................................................................23
11.1. Starting OpenAS2................................................................................................................. 23
11.2. Command Entry.................................................................................................................... 25
11.3. Automated Launching As UNIX Daemon............................................................................ 26
11.3.1. INIT.D Service.............................................................................................................. 26
11.3.2. SYSTEMD Service....................................................................................................... 27
12. Testing OpenAS2 Transfers..........................................................................................................27
12.1. Using HTTPS Transport....................................................................................................... 27
13. Troubleshooting OpenAS2........................................................................................................... 28
13.1. Canonicalization For MIC Algorithm...................................................................................28
13.2. Binary Encoding................................................................................................................... 28
13.3. HTTP Restricted Headers..................................................................................................... 29
13.4. CMS Algorithm Protection................................................................................................... 29
13.5. SSL Certificate Exceptions................................................................................................... 29
13.6. Java Versions Prior To 1.6.....................................................................................................31
13.7. Mime Body Part Logging..................................................................................................... 31
13.8. TLSv1.2................................................................................................................................ 31
13.9. HTTP Read Timeout Errors.................................................................................................. 31
13.10. Out Of Memory And File Size Issues................................................................................. 32
13.11. File System Issues...............................................................................................................32
14. Partner AS2 Compatibility Settings..............................................................................................32
15. Remote Control............................................................................................................................ 32
16. Dynamic Variables........................................................................................................................33
17. Appendix: config.xml file structure..............................................................................................35
18. Appendix: partnership.xml file structure...................................................................................... 43
19. Appendix: command.xml file structure........................................................................................ 45
20. Appendix: Updating database structure........................................................................................45
21. Appendix: Creating database DDL for external databases........................................................... 46
22. Appendix: Upgrading................................................................................................................... 47
23. Appendix: Clustering and Load Balancing...................................................................................47
24. Appendix: Maven Artifacts...........................................................................................................49
1. Introduction
The OpenAS2 application enables you to transmit and receive AS2 messages with EDI-X12,
EDIFACT, XML, or binary payloads between trading partners. The AS2 implementation conforms
with RFC4130 supporting the 1.1 specification.
This document describes how to install, configure and use OpenAS2. An appendix provides
information on upgrade procedures as new versions of the application are released.
In this document a partner can be either your own company or a company you will be exchanging
data with using AS2.
The sample configurations in this document are based on Unix type OS but in general the only
significant difference is that it may be necessary to use “\” instead of “/” for folder name separators
on Windows based machines but because the application is Java it should work fine leaving the “/”
for the most part as Java will do the conversion if necessary.
This document is valid for version 2.4.0 and up.
2. Glossary
EDI – Electronic Data Interchange
MDN - Message Disposition Notification
3. Installing OpenAS2
3.1. System Requirements
To be able to run the OpenAS2, you will need:
1. Java™ installed on the machine you intend to run the OpenAS2 server on – this document
uses Java 1.6.
2. The OpenAS2 package version you wish to use. The downloadable packages can be found
here: https://sourceforge.net/projects/openas2/files
3. Java Cryptography Extension (JCE) policy files - you can download the correct version
from the Java website. Search “Java Cryptography Extension Unlimited Strength“ to find
the right cryptography extension for your version of Java. The current link for Java8 is here.
2. For the encryption and certificate management to work correctly, you must have the proper
JCE policy files installed in your version of Java (see system requirements above). The
downloaded zip archive contains the two files local_policy.jar and
US_export_policy.jar. Install them into your Java location under
<JAVA_HOME>/lib/security. Back up the existing files before installing these new
ones. There are numerous detailed articles on the web for installing these files if you need
more information.
The file structure will look something like the figure below without the data and logs folders which
are created automatically by the server when it starts based on configuration if they do not exist.
3.3. Tuning Java
The default settings for the Java virtual machine in the startup script (start_openas2.sh or
start_openas2.bat) will work for installations on most machines for low volume/small file size
transfers. However, if your system will be transferring large files you will need to increase memory
allocation. If you expect to support very high AS2 traffic you will need to increase memory
allocation and possibly tune the garbage collector to get reasonable performance.
How much you can increase memory allocation to Java will depend on how much RAM is installed
on the system running OpenAS2 and how many other processes will be running concurrently that
will also require memory. Most systems deploy with at least 8GB RAM these days so increasing
memory allocation from the default amount in the startup script should not cause adverse affects to
the system.
To increase memory allocation you need to increase the heap space. This is set using the -Xmx
option. You could increase this from the 384m (m = MB) default setting to 1g or 2g to get good
performance for larger files or busy systems and for very large files given enough RAM you can set
it to 6g or 8g. Search for “-Xmx” in the startup script and adjust accordingly.
For garbage collection you may want to allocate a more appropriate garbage collector than the
default parallel collector that is the default in Java. In Java 7 and up, the G1 collector is ideal if you
use large heap space allocation. To enable it add this to the command line parameter:
–XX:+UseG1GC
Based on basic internal testing and user feedback, the following are guidelines for setting your heap
space (Xmx):
• files up to 50MB – 384m
• files up to 150MB – 756m
• files up to 300MB - 2g
• files up to 500MB – 3g
• files up to 750MB - 4g
4. Configuration Overview
This section explains the details of the configuration files and how they link together.
The OpenAS2 server uses four files to configure and execute:
1. config.xml – configures the application such as the types of modules that are started, the
logging systems, command processors and global properties
2. partnerships.xml – configures the partners and partnerships. Provides the ability to specify
different signing and encryption algorithms, message compression, MDN handling etc
3. as2_certs.p12 – a PKCS12 keystore that stores the SSL certificates used to secure the
messages for all partners. It contains the primary key for your own company as well as the
public keys for all your trading partners
4. commands.xml – the application provides a way to enter commands to control and configure
the system whilst it is running either via the console or a remote tool (configured in the
config.xml file above). This file stores the commands that the application will support. This
file should not be modified
IMPORTANT: A restart of the application is required to load any configuration changes.
The folder containing the config.xml file defines the home configuration parameter that can be used
to reference other files on the file system relative to a known base folder in the app. This is done by
encapsulating home in percentage signs (%home%). All files can be referenced relative to this
parameter and it is how the default config.xml file defines the location of other configuration and
data file locations used by the OpenAS2 application.
5. Application Configuration
The file named “config.xml” configures the modules that will be activated by the AS2 server when
it starts up. This file can be located anywhere within the disk subsystem on which the OpenAS2
application runs as it is passed into the application as a startup parameter.
Some of the key configuration settings in the config.xml file are:
• define the modules to be activated in the OpenAS2 application
• enhance or change behaviour of modules and the inputs and outputs of the modules.
Use of an external database can be configured for any database that has a JDBC driver such as
Oracle, MySql or Postgresql.
To use an external database:
• put the appropriate JDBC driver jar for the SQL system you want to use into the “lib” folder
of the OpenAS2 install
• the “use_embedded_db” attribute must be set to “false” and the appropriate settings
changed in the database tracking module XML.
The user name and password can be changed using either a JDBC connection or the command line
tool as described below. It is recommended that a readonly user is added for reading data from the
database.
To connect to the H2 database whilst OpenAS2 is running use this JDBC connect string:
jdbc:h2:tcp://localhost:9092/openas2
To query the database from the command line, you must have OpenAS2 running then use this
command:
java -cp [path to OpenAS2 install]/lib/h2-1.4.192.jar org.h2.tools.Shell -user sa -password OpenAS2 -url
jdbc:h2:tcp://localhost:9092/openas2
There is a file named db_ddl.sql file located in the config folder that can be used to create the
necessary table structure if your DB becomes corrupted. The simplest way to recreate the database
table is using this command whilst OpenAS2 is running:
java -cp [path to OpenAS2 install]/lib/h2-1.4.192.jar org.h2.tools.RunScript -user sa -password OpenAS2 -url
jdbc:h2:tcp://localhost:9092/openas2 -script [path to OpenAS2 install]/config/db_ddl.sql
The above is for the version of H2 deployed with OpenAS2 version 2.1.0. If you use a different
version of H2 then change the jar name to reflect this.
NOTE: The version of H2 deployed with the application only works in Java 7 or higher. Download
the older version of H2 that was compiled with support for Java 1.6 if you wish to use Java 6:
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/h2database/h2-
2014-01-18.zip (Replace the jar in the OpenAS2 lib folder with that version and change the startup
script to include the replaced version of H2, delete the files in <installDir>/config/DB, restart
OpenAS2 server and recreate the database using the command referenced above).
See appendixes for information on creating external database DDL statements and updating the
existing database if the schema is changed in a new release.
This can be set by using an additional parameter to the batch script file so that it can be set as part of
invoking the script. The UNIX shell script will support the password as a parameter. The Windows
bat file will need to be enhanced.
HTTPS transport can be configured as per section Configuring HTTPS Transport in this document.
See the appendix for notes on deploying OpenAS2 in a clustered/load balanced environment.
6. Partner Configuration
The file named partnerships.xml configures all the information relating to the partners you will be
exchanging data with. See the appendix for information on the structure of this file.
It is important to keep in mind that the word partner refers to any entity specified as a recipient or
sender of AS2 messages and includes your own company that you might be configuring the
application for.
6.2.1. Signing
Signing is controlled by the “sign” attribute in the “partnership” element. Remove this element from
the partnership to send a message without signing.
6.2.2. Encryption
Encryption is controlled by the “encrypt” attribute in the “partnership” element. Remove this
element from the partnership to send a message without encryption.
To change this globally for all partnership definitions, change the property in the config.xml file to
the desired format string using the attribute name “as2_message_id_format” in the “properties”
element.
The message Id that is generated can be overridden on a partnership by partnership basis. To set it
for a particular partnership, add an attribute named "messageid" to the partnership definition and
use any dynamic parameters as specified in the dynamic parameters section of this document.
Something like this:
<partnership name="OpenAS2B-to-OpenAS2A">
<sender name="OpenAS2B"/>
<receiver name="OpenAS2A"/>
<attribute name="protocol" value="as2"/>
<attribute name="content_transfer_encoding" value="binary"/>
<attribute name="messageid" value="ACME-$date.yyyyMMddHHmmssZ$-$rand.UUID$"/>
Regular expressions uses Java regular expressions and requires that the regular expression is
constructed in grouping mode where the number of groups in the regular expression exactly
matches the number of attribute names in the “attribute_names_from_filename” attribute.
Regular expressions can become extremely complex and this document will show some simple
examples but there are many sites that provide regular expression tutorials if you need a
complicated solution.
If the file name was ABC-123-H4FT_INVOICES.csv there would be 2 attributes added as:
X-attribute1 value ABC
Y-attribute2 value 123—HFT_INVOICES
If the file name was ABC-123-H4FT_INVOICES.txt or ABC_123.csv the system would throw
an error since there would be no match.
The above attributes could be referenced in config to set a more dynamic subject using something
like this:
<attribute name="subject" value="Target product: $attributes.X-attribute1$ Sequence Count:
$attributes.Y-attribute2$"/>
This would produce a subject looking like this:
Target product: ABC Sequence Count: 123-INVOICES
7. Certificate Configuration
The first step is to set up your own private certificates so that you can accept inbound messages and
an associated public certificate that your partner will use to encrypt and sign the message they send
to you and for any MDN responses that your partner returns as a result of sending them a message.
Once you have your own certificates set up then you can import partner public certificates for
signing and encrypting messages to be sent to them.
The certificate store used by default is a PKCS12 key store and stores all X.509 certificates for all
trading partners.
The location and name of the certificate keystore is defined in “filename” attribute of the
“certificates” element in the config.xml file. The default deployment uses the file
<installDir>/config/as2_certs.p12
The application supports certificate management via the command interface but the functionality is
limited and you will need to use 3 rd party tools for creating and manipulating ceertificates to a
format that can be used in the OpenAS2 command interface.
An excellent open source visual keystore manager that will run on any OS and will allow importing
and managing certificates in your keystore can be found here: http://portecle.sourceforge.net/
7.1. My Certificates
You can have multiple certificates per trading partner for increased security (each partner is sent a
unique certificate and there is a matching private key for each certificate in your keystore) or just
have a single certificate for all trading partners (all partners are sent the same certificate and there is
only one private key in your keystore to match).
Your own certificate(s) will always be imported from a keystore that contains both the private key
and the certificate.
NOTE: SHA1 certificates are no longer supported and are rapidly being phased out so you should
use SHA256 for all partners that do support SHA256 certificates.
The following steps will create an X509 self signed certificate using OpenSSL:
openssl req -x509 -newkey rsa:4096 -keyout priv.key -out selfcert.crt -days 3650 -sha256
To import the public certificate and private key you create a temporary PKCS12 key store that will
be used to import the public/private key pair:
openssl pkcs12 -export -in selfcert.crt -inkey priv.key -out certs.p12 -name my_new_alias
The file named certs.p12 is now a PKCS12 keystore containing the private key and the certificate
and can be imported into the OpenAS2 keystore via the command interface using a command like
this:
cert import my_new_alias certs.p12 <keystore password>
If you are replacing your existing keystore completely then simply delete the existing keystore and
copy the new one into the same folder with the same name as the old one (of course this will delete
any partner certificates you may have imported to the old key store).
NOTE: It is important to use ".p12" as the extension when importing certificates from a PKCS12
keystore as the importer requires the “.p12” extension to detect that you are not importing a
certificate directly but rather the certificates in a PKCS12 keystore.
This should be run against the temporary keystore when creating the private key and certificate in the section
above as it will create a PEM file containng only that specific certificate.
You can run it against the keystore as configured in the OpenAS2 application but it will export all certifictes
in the keystore and you will have to edit the file to extract only the one you are interested in.
For each additional certificate you support, you then add another <partner> element. If for instance
you have SHA1 already deployed and working with existing partners and you create a SHA256
certificate to support a new partner, you add a new <partner> element something like this:
<partner name="MyCompany256" as2_id="MyCompany2_OID"
x509_alias="MyCompanyCert256" email="[email protected]"/>
In your partnership definition for the partners using the SHA256 certificate you set the "sender" and
"receiver" attribute as appropriate to point to the correct partner definition ("MyCompany256" per
the example above) along with changing the SHA1 to SHA256 in the other relevant attributes as
shown in the snippet below.
<partnership name="MyCompany256-to-MyPartner256">
<sender name="MyCompany256"/>
<receiver name="MyPartner256"/>
<attribute name="protocol" value="as2"/>
...
</partnership>
Import the new certificate into the existing p12 keystore using the alias as defined in the x509_alias
attribute above ( "MyCompany2Cert256" ) and send the partner the matching public key for the
new certificate along with the as2_id "MyCompany256_OID" that they will need to use so you can
differentiate your target definition in the partnership file containing the SHA1 certificate from the
SHA256 certificate. See the previous section for importing certificates into your existing keystore.
8. Logging System
Loggers are configured in the config.xml file using the “loggers” element.
By default the OpenAS2 system deploys with the console and file system loggers enabled.
All log classes can be overridden or custom logger classes can be coded and included via
configuration to support custom logging applications or SaaS log management systems.
The configuration values can overwrite each other depending on the source of the configurtion
value. The order of priority is as follows:
1. values set in the logger element attributes
2. entries in the file identified by javax.mail.properties.file
3. entries using system properties
For example, to pass the port for connection you could add this to the command line:
-Dmail.smtp.port=529
To point to a properties file containing all the relevant information you would add something like
this:
<logger classname="org.openas2.logging.EmailLogger"
javax.mail.properties.file="%home%/java.mail.properties"
from="openas2"
…
9. MDN Configuration
MDN's can be sent synchronously or asynchronously. By default the system will use synchronous
MDN mechanism. Per the AS2 specification, an MDN will only be sent on receipt of an AS2
message if the “Disposition-Notification-To“ header is present in the received message with a non-
empty value. Although this value is specified to be configured with an email address, it is not
utilized for any purpose in the AS2 protocol other than to indicate an MDN is required so can in fact
be any random string. To set the “Disposition-Notification-To“ header in an outbound message,
the “as2_mdn_to” attribute must be set on the partnership.
The other attribute that must be set is the “as2_mdn_options”. This defines the encryption
algorithm and other MDN settings as specified by the AS2 protocol and the value entered for this
attribute will be sent in the “Disposition-Notification-Options” header of the AS2 message.
Generally changing the encryption algorithm to suit the trading partner should be sufficient on this
attribute.
9.1. Asynchronous MDN Receiver Configuration
In order to specify an asynchronous MDN response from a partner requires setting the following
attribute on the partnership element in the partnership configuration:
• as2_receipt_option – set to the URL of the asynchronous MDN receiver to target the
asynchronous MDN receiver module configured in the config file (ie. this is the URL that
the partner will send the MDN to). The value set in this attribute will be sent in the
“Receipt-Delivery-Option” header of the AS2 message to the trading partner. For testing
using the default config file that comes with the OpenAS2 installation package, set this to:
http://localhost:10081
Receiving an asynchronous MDN requires the “AS2MDNReceiverModule” module. This module
declaration requires a port parameter in addition to the class and can be entered as a child member
of the processor node in the config file as shown below:
<module classname="org.openas2.processor.receiver.AS2MDNReceiverModule" port=”10081” />
For Unix based systems such as Linux and OSX, open a terminal window and change directory to
the “bin” folder of the install. The start_openas2.sh file should have execute permissions in which
case simply type the name and press enter. If no execute permissions are set, either set the execute
permission as needed or use “bash” to run the script:
/opt/OpenAS2:>bash opensas2.sh
The output in a Unix based system will be identical to that in a Windows based system.
The following system property will have to be passed to the application in the java command line:
-Dorg.openas2.cert.TrustSelfSignedCN=www.openas2.localhost
If you experience problems with SSL, try adding this to the startup command in the script file:
-Djavax.net.debug=SSL
IMPORTANT NOTE: This change cannot be made partner specific due to the
way it is implemented in Java so all configured partners will then
receive restricted HTTP headers so they may fail as a result of this
change. Your only way around this is to run separate OpenAS2 instances.
NOTE: If there is no existing keystore you want to add it to then leave out the password
otherwise it will throw an error. You can use the keytool utility that comes with java to
change the keystore password if you wish but since it does not contain any private keys
there is little point in changing the password but if you do then you will have to pass the
new password in to the OpenAS2 app using the javax.net.ssl.trustStorePassword property.
If the class only receives a single certificate as response from the remote host it generally
indicates that the root certificate is not trusted and will need installing into a keystore for use
by the OpenAS2 application. The output from the class should make it clear it was unable to
successfully complete an SSL handshake and it will import the certificate (root or chain as
necessary) into the keystore.
2. Add the local cert store to the OpenAS2 startup by adding this to the startup command in the
relevant batch file you are using to start OpenAS2:
-Djavax.net.ssl.trustStore=<pathToKeystore>/<localKeystoreFile>
13.8. TLSv1.2
It appears that although Java7 does support TLSv1.2 it is not enabled by default (refer here:
https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https)
If you need to use the protocol, add the following to the top of the batch shell script that starts
OpenAS2:
Windows: set EXTRA_PARMS=%EXTRA_PARMS% -Dhttps.protocols=TLSv1.2
Linux/Unix/OSX: EXTRA_PARMS=$EXTRA_PARMS -Dhttps.protocols=TLSv1.2
AS2 System Allow Restricted Headers Prevent Canonicalization For Remove CMS
(startup script property: MIC Algorithm Protection
sun.net.http.allowRestrictedH (partner attribute: (partner attribute:
eaders) prevent_cononicalization_for_ remove_cms_algorithm_
mic) protection_attrib)
IBM Sterling false true
IBM Datapower false true
Mendelson false true
Seeburger ? ? ?
Oracle Integration false false false
B2B
Amazon false true false
15. Remote Control
By default the OpenAS2 server application will start up a command processor as a socket listener
allowing remote connection to the OpenAS2 server to execute commands. The OpenAS2 remote
application is part of the application package but is not necessary to use it if you have no remote
access requirement and should be disabled in the config.xml file if not using it by removing or
commenting out the <commandProcessor> element with classname value
org.openas2.cmd.processor.SocketCommandProcessor
You can set the port that the command processor listens on using the portId parameter.
<commandProcessor
classname="org.openas2.cmd.processor.SocketCommandProcessor" portId="14321"
userid="userID" password="pWd"/>
The remote control application will need to connect to the specified port with the specified user ID
and password.
The connection uses an anonymous secure socket cipher and may require changing this if your Java
implementation does not support the default cipher which is
TLS_DH_anon_WITH_AES_256_CBC_SHA for the latest release. This cipher is not available in
older Java versions and it may be necessary to switch to SSL_DH_anon_WITH_RC4_128_MD5
To switch cipher you will need to start the OpenAS2 server and the remote command client passing
the cipher name as a system property using the -D switch that can be added to the batch script that
starts the application. The property must be named “ CmdProcessorSocketCipher”.
Attributes
classname
describes the Java class to process the certificate file.
for example: org.openas2.cert.PKCS12CertificateFactory
filename
defines the file name containing the certificates
for example: %home%/certs.p12
password
opens the file using this password
for example: test
NOTE: this can be overriden using a java system property
when starting the application:
-Dorg.openas2.cert.Password=<somePassword>
interval
describes how often the file should be check up for updates. Specified
in seconds.
for example: 300
• Node: partnerships
Describes the OpenAS2 classes to handle the trading partner identifications.
Attributes
classname
describes the Java class to process the partnerships file
for example: org.openas2.partner.XMLPartnershipFactory
defines the file name containing the partnerships definitions
describes
for example: %home%/partnerships.xml
• Node: loggers
Describes the OpenAS2 logging classes to use. You must include
-Dorg.apache.commons.logging.Log=org.openas2.logging.Log in your startup
call or as a property in the commons-logging.properties file. See
http://commons.apache.org/logging/guide.html#commons-logging-api.jar for
more information.
Do not use this node when using other logging packages (e.g. log4j) with the
OpenAS2 package.
Attributes
classname
describes the Java class to process E-mail logging
for example: org.openas2.logging.EmailLogger
show (Optional)
describes what level of logging to handle
Possible values
• all = all exceptions (terminated or not) and info
• terminated = all terminated exceptions Default value
• exceptions = all non-terminated exceptions
smtppwd
defines user password if authentication is required for the SMTP
server
subject
describes the e-mail to the receiving party
for example: $exception.name$: $exception.message$ (only
relevant a specific exceptions type)
bodytemplate
defines the file that contains the body of the message
for example: %home%/emailtemplate.txt
• Node: logger (for file logging)
Optional, if not specified no file logging is performed.
Attributes
classname
describes the Java class to log messages
for example: org.openas2.logging.FileLogger
filename
defines the name of the output log file.
for example: %home%/log-$date.MMddyyyy$.txt
show (Optional)
describes what level of logging to handle
Possible values
• all = all exceptions (terminated or not) and info Default
value
• terminated = all terminated exceptions
• exceptions = all non-terminated exceptions
• info = all info log entries
Attributes
classname
describes the Java class to log messages
for example: org.openas2.logging.ConsoleLogger
show (Optional)
describes what level of logging to handle
Possible values
• all = all exceptions (terminated or not) and info Default
value
• terminated = all terminated exceptions
• exceptions = all non-terminated exceptions
• info = all info log entries
Attributes
classname
describes the Java class to process the command file
for more information see Command File
for example: org.openas2.app.XMLCommandRegistry
filename
defines the name of the file command all possible commands
for example: %home%/commands.xml
• Node: processor
Describes the OpenAS2 class to handle the message processors.
Attributes
classname
describes the default Java class to handle outgoing message
for example: org.openas2.processor.DefaultProcessor
• Node: module
Module that sends out AS2 messages.
Attributes
classname
describes the Java class to send outgoing Messages
for example: org.openas2.processor.sender.AS2SenderModule
retry
defines the number of attempts for sending a message,default is
-1 aka infinite.
for example retries="3" will stop sending the message after 3
failures.
connecttimeout
defines the millisecond count before a connection times out.
default value is 30000 or 30 seconds.
for example connecttimeout="60000" will time out after 60
seconds.
readtimeout
defines the millisecond count before a read times out. default
value is 30000 or 30 seconds.
for example readtimeout="60000" will time out after 60
seconds.
• Node: module
Module that sends out AS2 MDNs asynchronously.
Attributes
classname
describes the Java class to send asynch MDN
for example:
org.openas2.processor.sender.AsynchMDNSenderModule
retry
defines the number of attempts for sending a message, default
value is -1 (infinite.)
for example retries="3" will stop sending the message after 3
failures.
connecttimeout
defines the millisecond count before a connection times out.
default value is 30000 or 30 seconds.
for example connecttimeout="60000" will time out after 60
seconds.
readtimeout
defines the millisecond count before a read times out. default
value is 30000 or 30 seconds.
for example readtimeout="60000" will time out after 60
seconds.
• Node: module
The following will describe a module to process outgoing message placed in
a generic directory. The module determines the receiver and send from the file
name placed in the directory (see format attribute). This module will look for
files in specified directory and file names to send to the default message
processor.
Attributes
classname
describes the Java class to process files to be sent to the
AS2SenderModule for its delivery process.
for example:
org.openas2.processor.receiver.AS2DirectoryPollingModule
outboxdir
defines the directory where files are to be found.
for example: %home%/toAny
fileextensionfilter
defines the extension of the file name if file filtering is required.
The system will prefix the text entered in this attribute with a
period and only files matching that extension will be picked up
by the polling module
for example: txt - this will only find files like test.txt but not
mytxt
errordir
defines directory where files containing errors are redirected to.
for example: %home%/toAny/error
interval
describes how often the directory is to be checked for work.
Specified in seconds. Default is 30 seconds.
for example: 5
delimiters
defines the characters used to parse the incoming file name.
Characters are separate the tokens: sender, receiver and file id.
for example: -.
format
describes the file name by the tokens sender, receiver and file id.
May be in any order. Sender id and receiver id are as defined in
the partnership.xml file.
for example: sender.as2_id, receiver.as2_id, attributes.fileid
or attributes.mimetype, attributes.mimesubtype, sender.name,
receiver.name
mimetype
describes the outgoing message mime message type.
for example: application/EDI-X12
• Node: module
Attributes
classname
describes the Java class to process files for a particular trading
partner that are sent to the AS2SenderModule for its delivery
process.
for example:
org.openas2.processor.receiver.AS2DirectoryPollingModule
outboxdir
defines the directory where outgoing message are defined.
for example: %home%/toOpenAS2A/
errordir
defines the directory where erroneous messages are left.
for example: %home%/toOpenAS2A/error
interval
describes how often the incoming directory is searched. Defined
in seconds, default is 30 seconds.
for example: 5
defaults
describes the AS2 sender and receiver ids as defined in the
partnership.xml file.
for example: defaults="sender.as2_id=OpenAS2A_OID,
receiver.as2_id=OpenAS2B_OID"
protocol
describes the AS2 protocol, which is AS2.
for example: as2
mimetype
describes the outgoing message mime message type.
for example: application/EDI-X12
• Node: module
Attributes
classname
describes the Java class to process incoming MDNs
for example: org.openas2.processor.storage.MDNFileModule
filename
describes
for example: %home%/mdn/$date.yyyy$/$date.MM$/
$mdn.msg.sender.as2_id$-$mdn.msg.receiver.as2_id$-
$mdn.msg.headers.message-id$
protocol
describes
for example: as2
tempdir
describes
for example: %home%/temp
• Node: module Defines the module to handle messages.
Attributes
classname
describes the Java class to process and store incoming messages
for example:
org.openas2.processor.storage.MessageFileModule
filename
describes the location and formatted filename of the stored
MDNs.
for example: %home%/inbox/$msg.sender.as2_id$-
$msg.receiver.as2_id$-$msg.headers.message-id$
protocol
describes the AS2 protocol
for example: as2
tempdir (Optional)
defines temporary directory used to store MDNs during message
processing.
for example: %home%/temp
• Node: module
Attributes
classname
describes the Java class to process handle incoming transfers
for example:
org.openas2.processor.receiver.AS2ReceiverModule
port
defines the port the server listens on.
for example: 10080
errordir
defines directory where invalid incoming messages are stored.
for example: %home%/inbox/error
errorformat
defines the format of filenames for invalid incoming messages.
for example: sender.as2_id, receiver.as2_id, headers.message-id
protocol
optional and defaults to “http” if not present
set to “https” for SSL transport protocol
ssl_protocol
optional and defaults to “TLS” if not present
set to preferred SSL transport protocol
for example: SSLv3
ssl_keystore
The name of the file including path containing SSL certificate
only required for “protocol” attribute set to “https”
for example: %home%/ssl_certs.jks
ssl_keystore_password
The password to open the SSL keystore
only required for “protocol” attribute set to “https”
for example: mySecretPassword
NOTE: this can be overriden using a java system property
when starting the application:
-Dorg.openas2.sslPassword=<somePassword>
• Node: module
Attributes
classname
describes the Java class to send asynchronous MDN response
for example:
org.openas2.processor.receiver.AS2MDNReceiverModule
port
defines the port the server listens on.
for example: 10080
protocol
optional and defaults to “http” if not present
set to “https” for SSL transport protocol
ssl_protocol
optional and defaults to “TLS” if not present
set to preferred SSL transport protocol
for example: SSLv3
ssl_keystore
The name of the file including path containing SSL certificate
only required for “protocol” attribute set to “https”
for example: %home%/ssl_certs.jks
ssl_keystore_password
The password to open the SSL keystore
only required for “protocol” attribute set to “https”
for example: mySecretPassword
NOTE: this can be overriden using a java system property
when starting the application:
-Dorg.openas2.sslPassword=<somePassword>
• Node: module
Attributes
classname
describes the Java class to rehandle messages
for example:
org.openas2.processor.resender.DirectoryResenderModule
resenddir
defines the directory to find message to resend
for example: %home%/resend
errordir
defines the director to store resend messages that are in error.
for example: %home%/resend/error
resenddelay
defines the wait time between resends. Defined in seconds.
Default is 60.
for example: 600
18. Appendix: partnership.xml file structure
This file describes your company and your trading partners. This file requires modification to work
with your application
• Node: partnerships
The root node.
• Node: partner
partner definition
Attributes
name
partner name as defined in OpenAS2 configuration file.
OpenAS2A
as2_id
partner name as defined in partnership node
OpenAS2A
x509_alias
Alias as defined in certificate file
openas2a
email
E-mail address of partner
[email protected]
• Node: partnership
defines partner relationships between sender and receiver
• Node: partnership
Attributes
name
Unique name of partnership relation. See filename parsing above.
OpenAS2A-OpenAS2B
• Node: sender
Attributes
name
Unique name of Sender
OpenAS2A
• Node: receiver
Attributes
name
Unique name of receiver
OpenAS2B
The following is a list of nodes that use the node name of attribute. The
subnodes of attribute use a name/value node naming pair structure.
• Node: attribute
name is protocol defines the protocol to use with this partner.
value is as2
name="protocol" value="as2"
• Node: attribute
name is subject defines text used in E-mail subject line
value
name="subject" value="From OpenAS2A to OpenAS2B"
• Node: attribute
name is as2_url defines partners AS2 server's URL
value
name="as2_url" value="http://www.MyPartnerAS2Machine.com:10080"/>
• Node: attribute
name is as2_mdn_to when set this specifies that an MDN response is
required and defines value of the “"Disposition-Notification-To" header
in the AS2 message sent to the partner. It is normally an email address but can
be any string that is meaningful
value
name="as2_mdn_to" value="[email protected]"
• Node: attribute
name is as2_receipt_option defines asynchronous MDN server's URL
value
name="as2_receipt_option" value="http://www.MyAS2Machine.com:10081"
• Node: attribute
name is as2_mdn_options defines MDN option values for E-mail header
value
name="as2_mdn_options" value="signed-receipt-protocol=optional, pkcs7-
signature; signed-receipt-micalg=optional, sha1"
• Node: attribute
name is encrypt defines encrypting algorithm name for E-mail header
value
name="encrypt" value="3des"
• Node: attribute (optional)
name is content_transfer_encoding defines what the header field should
display
value 8bit (default), binary, ...
name="content_transfer_encoding" value="binary"
attribute
name
value "cert|part", certificate commands or partnership commands
description
value is some useful text
• Node: command
attribute
classname
value is a OpenAS2 classname that will process a command
• axion
• cloudscape
• db2
• derby
• firebird
• h2
• hsqldb
• interbase
• maxdb
• mckoi
• mssql
• mysql
• oracle
• postgresql
• sapdb
• sybase
1. Create a database with the desired name , user and password in the target database system
2. Change the property named “platform” in the build.xml file to the required database
platform
3. Set up a jdbc.properties file with the appropriate settings using the jdbc.properties.h2 file as
a template.
4. Create the database table. To generate DDL statements to an SQL file that can then be used
to apply to the database use this command:
ant -Djdbc.properties.file=jdbc.properties
To directly update the database without generating a DDL file use this command:
5. Change the appropriate parameters in the config.xml file for the database tracking module.
22. Appendix: Upgrading
Each release contains a RELEASE-NOTES.txt file. This file contains a section specifically about
upgrading to use new functionality if there was any config related new functionality in that release.
There will be no upgrade notes for the particular release if it was just a bugfix or minor
enhancement where there is no config to be done. You should add any configuration related
elements to the appropriate XML file(s) if you wish to use new functionality that requires
configuration settings.
The basic upgrade path is as follows:
1. partnerships.xml : Review the release notes for any new attributes that are supported in the
partnerships.xml and add if there is a perceived advantage/enhancement (in general the
partnerships.xml should not need any modification if it already works as all enhancements to
the partnership configuration have ensured they do not change the default behavior from
prior versions)
2. config.xml: Review and merge any new configuration into your existing config.xml.
Generally it should be fairly obvious where there are "missing" items in your existing file
compared to the version you are upgrading to. For performance purposes, make sure you do
not add unwanted modules and perhaps a good idea to review any modules you have not
used but have enabled such as the remote command processor, socket logging etc.
3. Review the startup script (start_openas2.sh or start_openas2.bat) and merge any
enhancements you may have made in your deployed version into the new version and
replace the old version if necessary. Specifically ensure you set the classpath appropriately
to cater for upgraded or new libraries.
4. Delete all files in your "lib" folder and copy all the files from the release package "lib"
folder into your deployed folder.
NOTE: The alternative route is to unzip the new release into a new folder on your server and
follow steps 1, 2 and 3 above except merging the changes you made originally into the new
deployment. This route may be the quicker route if you have not customized the configuration files
extensively and will ensure you do not miss newly added configuration.