openas2_documentation
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| openas2_documentation [2023/03/02 10:36] – [11.1. SSL Certificates] kalaschnikow | openas2_documentation [2023/03/02 11:48] (current) – [8.4. My Certificates] kalaschnikow | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== OpenAS2 Documentation ====== | ||
| + | |||
| + | |||
| + | This is a conspect of the OpenAS2 documentation " | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | |||
| + | |||
| + | ===== 1. Introduction ===== | ||
| + | * The AS2 implementation conforms with RFC4130 supporting the 1.1 specification. | ||
| + | |||
| + | |||
| + | ===== 2. Glossary ===== | ||
| + | |||
| + | * EDI - Electronic Data Interchange | ||
| + | * MDN - Message Disposition Notification | ||
| + | * JCE - Java Cryptography Extension | ||
| + | |||
| + | ===== 3. Basic Functional Overview ===== | ||
| + | |||
| + | The OpenAS2 application provides the following mechanisms for sending and receiving files: | ||
| + | * Files to be sent are placed in folders that are detected by polling modules. | ||
| + | * These files and sent to the relevant AS2 partner using AS2 protocol. | ||
| + | * target partner is determined by | ||
| + | * folder name | ||
| + | * file name patterns | ||
| + | * If configured for MDN response, the MDN response will be stored in a folder defined by the MDN storage module | ||
| + | * Received files are placed in a location defined in the message storage module | ||
| + | * Default configuration creates dedicated inbox folders per partnership | ||
| + | * If configured for an MDN response, the application will automatically send an MDN that is by default signed. | ||
| + | |||
| + | All sent and received files are tracked in a database tracking system that updates the progress of the message state in the database at key points in the life cycle of message. | ||
| + | |||
| + | |||
| + | |||
| + | ===== 4. Installing OpenAS2 ===== | ||
| + | |||
| + | ==== 4.1 System Requirements ==== | ||
| + | |||
| + | * 1. Java | ||
| + | * 2. OpenAS2 package (https:// | ||
| + | * 3. Java Cryptography Extension (JCE) policy files | ||
| + | * Download from Oracle (Oracle user account necessary!) | ||
| + | |||
| + | ==== 4.2 Installing Application ==== | ||
| + | |||
| + | * 1. Unzip OpenAS2 package | ||
| + | * Normally under '' | ||
| + | * 2. Install proper JCE policy files | ||
| + | * Copy '' | ||
| + | |||
| + | |||
| + | ==== 4.3 Tuning Java ==== | ||
| + | |||
| + | * Increase heap space | ||
| + | * '' | ||
| + | * Set G1 garbage collector | ||
| + | * '' | ||
| + | |||
| + | ===== 5. Configuration overview ===== | ||
| + | |||
| + | ==== 5.1. Key Configuration Concepts ==== | ||
| + | |||
| + | OpenAS2 server uses four files for configuration: | ||
| + | * '' | ||
| + | * types of modules that are started | ||
| + | * the logging systems | ||
| + | * command processors | ||
| + | * global properties | ||
| + | * '' | ||
| + | * partners and partnerships | ||
| + | * signing and encryption algorithms | ||
| + | * message compression | ||
| + | * MDN handling | ||
| + | * '' | ||
| + | * a PKCS12 keystore which stores SSL certificates to secure communication for all partners | ||
| + | * contains: | ||
| + | * primary key of your company | ||
| + | * public key for all partners | ||
| + | * '' | ||
| + | * contains commands which the application will support | ||
| + | * normally this file should NOT be modified | ||
| + | |||
| + | |||
| + | ==== 5.2. Dynamic Configuration Changes ==== | ||
| + | |||
| + | * The system will monitor the partnership configuration file and the as2 certificates file for any changes to the files after the application has started. | ||
| + | * the config.xml file is NOT monitored for changes and will require a restart of the application for any changes. | ||
| + | |||
| + | ==== 5.3. “home” Configuration Parameter ==== | ||
| + | |||
| + | The folder containing the config.xml file defines the home configuration parameter '' | ||
| + | This means the default home location for '' | ||
| + | ==== 5.4. Passing In Configuration Values ==== | ||
| + | |||
| + | The application supports 2 ways of passing in configuration parameters: | ||
| + | |||
| + | === 5.4.1. Environment Variables === | ||
| + | |||
| + | For instance, the password for the certificates file could be set like this in the '' | ||
| + | < | ||
| + | < | ||
| + | filename=" | ||
| + | password=" | ||
| + | interval=" | ||
| + | </ | ||
| + | |||
| + | Then set the password in the environment as below before running the startup script: | ||
| + | < | ||
| + | export AS2_CERTIFICATE_PWD=my_secret_password | ||
| + | </ | ||
| + | |||
| + | === 5.4.2. System Properties === | ||
| + | |||
| + | Environment variable replacement occurs BEFORE system properties so you can use environment variables to set properties in the config.xml which in turn are used for other config values. For instance, you can change this in the < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | To: | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== 6. Application Configuration ===== | ||
| + | |||
| + | ==== 6.1. System Level Properties ==== | ||
| + | |||
| + | ==== 6.2. Sending Files ==== | ||
| + | |||
| + | === 6.2.1. Directory Polling Configuration Attributes === | ||
| + | |||
| + | === 6.2.2. Generic Send Directory Poller === | ||
| + | |||
| + | === 6.2.3. Partnerships XML Defined Directory Poller === | ||
| + | |||
| + | Minimum required setting in a partnership is to enable a poller: | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | The default configuration (set in '' | ||
| + | |||
| + | If you want to override any of the attributes from the '' | ||
| + | relevant attribute you want to override into the '' | ||
| + | |||
| + | === 6.2.4. Config XML Defined Directory Poller === | ||
| + | |||
| + | === 6.2.5. Restricting Directory Files By Extension Or Name === | ||
| + | The directory polling module can be configured to only use files with a specific extension and/or exclude files with a specific extension and/or exclude files based on a regular expresssion match on the entire file name. | ||
| + | The following attributes are relevant: | ||
| + | * fileextensionfilter | ||
| + | * fileextensionexcludefilter | ||
| + | * filenameexcluderegexfilter | ||
| + | Example: | ||
| + | < | ||
| + | fileextensionfilter=" | ||
| + | fileextensionexcludefilter=" | ||
| + | filenameexcluderegexfilter=" | ||
| + | </ | ||
| + | The attributes are evaluated as an AND function so if any of the filters excludes a file it ignores the other filters and excludes the file from processing. | ||
| + | |||
| + | === 6.2.6. Auto Splitting Large Files === | ||
| + | |||
| + | ==== 6.3. Receiving Files ==== | ||
| + | |||
| + | To receive and persist files over AS2 from a partner the following should be configured: | ||
| + | |||
| + | * network receiver module | ||
| + | * file handler module | ||
| + | |||
| + | My current configuration: | ||
| + | < | ||
| + | <module enabled=" | ||
| + | classname=" | ||
| + | filename=" | ||
| + | header=" | ||
| + | protocol=" | ||
| + | tempdir=" | ||
| + | <module enabled=" | ||
| + | classname=" | ||
| + | port=" | ||
| + | errordir=" | ||
| + | errorformat=" | ||
| + | </ | ||
| + | |||
| + | |||
| + | === 6.3.1. Overriding Storage Location Per Partnership === | ||
| + | |||
| + | === 6.3.2. Providing Default File Name === | ||
| + | |||
| + | |||
| + | ==== 6.4. AS2 Message Tracking ==== | ||
| + | |||
| + | ==== 6.5. Overriding Certificate Store Password ==== | ||
| + | |||
| + | ==== 6.6. Resend Retry Configuration ==== | ||
| + | |||
| + | ==== 6.7. Asynchronous MDN Response Wait Time ==== | ||
| + | |||
| + | ==== 6.8. File Name Parsing ==== | ||
| + | |||
| + | ==== 6.9. Using A Proxy Server ==== | ||
| + | |||
| + | ==== 6.10. Health Check For High Availability Deployment ==== | ||
| + | |||
| + | === 6.10.1. Healthcheck URI On Existing AS2 Listener === | ||
| + | |||
| + | === 6.10.2. Dedicated Healthcheck Module === | ||
| + | |||
| + | === 6.10.3. HTTP User Agent Header === | ||
| + | |||
| + | |||
| + | ===== 7. Partner Configuration ===== | ||
| + | |||
| + | '' | ||
| + | < | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Where '' | ||
| + | |||
| + | So all other stuff is configured in '' | ||
| + | |||
| + | Each partner will require the following entries in the file: | ||
| + | * a ''< | ||
| + | * a ''< | ||
| + | * Separate ''< | ||
| + | |||
| + | |||
| + | ==== 7.1. Partner Definition ==== | ||
| + | |||
| + | * ''< | ||
| + | * '' | ||
| + | * '' | ||
| + | * It is also used by the general directory polling module to look up the partner names and hence the partnership definition where the as2_id of the sender and receiver are part of the transferred file name. | ||
| + | * '' | ||
| + | * can be verified with '' | ||
| + | |||
| + | ==== 7.2. Partnership Definition ==== | ||
| + | |||
| + | The ''< | ||
| + | |||
| + | The ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * NOTE: This attribute supports Dynamic Variables and can be used to target modify the URL dynamically. See the section " | ||
| + | * ''< | ||
| + | |||
| + | The partnership element attribute values supports using a key value string that can be used to reference other attributes within the same partnership element to ensure consistent configuration. The value field in an attribute can use the format '' | ||
| + | |||
| + | Example: | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | === 7.2.1. Signing === | ||
| + | |||
| + | Signing is controlled by the " | ||
| + | the partnership to send a message without signing. | ||
| + | |||
| + | Supported signing algorithms are: md2, md5, sha1, sha224, sha256, sha384, sha512 | ||
| + | |||
| + | === 7.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. | ||
| + | |||
| + | Supported algorithms are: 3des, cast5, rc2_cbc, aes128, aes192, aes256 | ||
| + | |||
| + | === 7.2.3. MDN MIC Algorithm === | ||
| + | |||
| + | The MDN must be signed using the same algorithm that the sent message was signed with. The recipient partner is told the signature algorithm via a field in the '' | ||
| + | < | ||
| + | < | ||
| + | value=" | ||
| + | signed-receipt-micalg=optional, | ||
| + | </ | ||
| + | If you need to send an unsigned MDN then set the attribute on the partnership as below: | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | === 7.2.4. Reject Unsigned Messages === | ||
| + | |||
| + | It is possible to reject unsigned messages.\\ | ||
| + | Global configuration (in '' | ||
| + | < | ||
| + | reject_unsigned_messages=" | ||
| + | </ | ||
| + | |||
| + | Partnership-specific configuration (through an attribute of '' | ||
| + | |||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | === 7.2.5. Dynamic AS2 Url Configuration === | ||
| + | |||
| + | There are 3 ways to set message attributes that can be used in the for dynamic URL’s: | ||
| + | * 1. Parsed from file name | ||
| + | * typically used for a generic directory polling module) | ||
| + | * 2. Explicitly set in the directory polling modules " | ||
| + | * Using this mechanism you would need different directories (ie multiple DirectoryPollingModule instances) per URL you want to use. | ||
| + | * 3. Combination of both methods above | ||
| + | |||
| + | ==== 7.3. Example Multi-Partner Configuration ==== | ||
| + | |||
| + | ==== 7.4. Configuring the AS2 Message ID ==== | ||
| + | |||
| + | The message ID used for uniquely identifying the message sent can be configured | ||
| + | |||
| + | * globally (in '' | ||
| + | < | ||
| + | < | ||
| + | log_date_format=" | ||
| + | sql_timestamp_format=" | ||
| + | as2_message_id_format=" | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | * partnership-specific (in '' | ||
| + | < | ||
| + | < | ||
| + | <sender name=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | $rand.UUID$"/></ | ||
| + | |||
| + | The same can be done with the MDN message ID: | ||
| + | * globally (in '' | ||
| + | * partner-specific (in '' | ||
| + | ==== 7.5. Content Type ==== | ||
| + | It is possible to override the default value of Content-Type MIME header used in the body MIME part using the '' | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | ==== 7.6. Content Transfer Encoding ==== | ||
| + | |||
| + | As of version 1.3.7, the default content transfer encoding uses '' | ||
| + | ==== 7.7. Supported Encoding Algorithms ==== | ||
| + | The currently supported encoding algorithms are: | ||
| + | * MD5 | ||
| + | * SHA1 | ||
| + | * SHA224 | ||
| + | * SHA256 | ||
| + | * SHA384 | ||
| + | * SHA512 | ||
| + | * CAST5 | ||
| + | * 3DES | ||
| + | * IDEA | ||
| + | * RC2_CBC | ||
| + | * AES128 (CBC mode) | ||
| + | * AES192 (CBC mode) | ||
| + | * AES256 (CBC mode) | ||
| + | * AES256_WRAP | ||
| + | ==== 7.8. Message Compression ==== | ||
| + | |||
| + | * The application supports inbound compression automatically. There is no configuration for this option. | ||
| + | * To enable outbound compression requires setting '' | ||
| + | * The only supported compression/ | ||
| + | |||
| + | * By default compression will occur on the message body part prior to signing. | ||
| + | * The compression can be configured to occur after signing using the '' | ||
| + | |||
| + | ==== 7.9. Custom Mime Headers ==== | ||
| + | Mime headers can be added to the outermost Mime body part for outbound messages and additionally added to the HTPP headers.\\ | ||
| + | ... | ||
| + | |||
| + | === 7.9.1. Static Header Values === | ||
| + | ... | ||
| + | === 7.9.2. Dynamic Header Values From File Name === | ||
| + | |||
| + | * Delimiter Mode | ||
| + | * Regular Expression Mode | ||
| + | |||
| + | === 7.9.3. Adding Custom Headers To HTTP === | ||
| + | ... | ||
| + | |||
| + | ==== 7.10. Setting Dynamic Attributes From File Name ==== | ||
| + | |||
| + | Partnership attributes can be added to the partnership definition based on parsing the file name of the document to be sent using a regular expression. Dynamic attributes require 2 partnership attributes: | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | The extracted name/value pairs can then be referenced in config using the format: '' | ||
| + | |||
| + | ... | ||
| + | ==== 7.11. HTTP Authentication ==== | ||
| + | |||
| + | For partners that require HTTP authentication when connecting to their system use the following | ||
| + | parameters in the partnership: | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | For sending files this is in the partnership where the partner is the receiver. | ||
| + | ===== 8. AS2 Certificate Configuration ===== | ||
| + | |||
| + | IMPORTANT: This section does NOT cover SSL certificates. SSL certificates are a completely separate set of certificates to the AS2 certificates (for SSL config for HTTPS see the appropriate section in this document) | ||
| + | ==== 8.1. Certificate Usage Overview ==== | ||
| + | Two different sets of certificates used in OpenAS2 and they are stored separately: | ||
| + | * AS2 (supports X.509 certificates for sending and receiving) | ||
| + | * SSL (for HTTPS) | ||
| + | |||
| + | Import the private and public keys and associated certificate into the OpenAS2 keystore and share the public key with the partner(s). | ||
| + | |||
| + | All trading partners will need to send you their public certificate that must be imported into the AS2 certificate keystore under a unique alias that identifies the particular trading partners public key in your keystore. | ||
| + | |||
| + | Encryption is done using the public key of an X.509 certificate and signing uses a private key. All certificates are stored in a single PKCS12 keystore and identified by their unique alias. | ||
| + | |||
| + | The communication flow for example for communication between " | ||
| + | * " | ||
| + | * //**fetch file**// to send | ||
| + | * // | ||
| + | * // | ||
| + | * // | ||
| + | * " | ||
| + | * //**verify signature**// | ||
| + | * // | ||
| + | * //**extract file**// from received message | ||
| + | ==== 8.2. Certificate Keystore Configuration ==== | ||
| + | |||
| + | In '' | ||
| + | < | ||
| + | < | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | </ | ||
| + | ==== 8.3. Managing Certificate Keystore ==== | ||
| + | |||
| + | Three strategies: | ||
| + | * 1. Command line scripts provided with OpenAS2 installation | ||
| + | * ''< | ||
| + | * ''< | ||
| + | * 2. Use a third party tools (like Portecle, OpenSSL or Java Keytool) | ||
| + | * 3. Use the OpenAS2 certificate management commands provided in the console command processor or via remote command processor | ||
| + | * this way is good when OpenAS2 is running as service (because the console is not available) | ||
| + | |||
| + | |||
| + | |||
| + | ==== 8.4. My Certificates ==== | ||
| + | You can have: | ||
| + | * multiple certificates per trading partner (each partner is sent a unique certificate and there is a matching private and public key for each certificate in your keystore). | ||
| + | * single certificate for all trading partners (all partners are sent the same public key and there is only one private key in your keystore to match). | ||
| + | For increased security it is highly recommended you use multiple certificates. | ||
| + | |||
| + | === 8.4.1. Creating Certificates === | ||
| + | |||
| + | Third party tools can be used for this purpose: | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * OpenSSL -> normally should be compiled by the user(!), but fortunately there are also already compiled packages like [[https:// | ||
| + | |||
| + | This documentation describes only OpenSSL commands. But the same can be done with other tools (e.g. with KeyTool Explorer). | ||
| + | |||
| + | The other option is to use scripts that are included in the installation package. For example this windows DOS shell script: | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | Running the script without arguments will show a usage description. | ||
| + | |||
| + | === 8.4.2. Creating Public Key For Sending To Partner === | ||
| + | |||
| + | The public key must be exported from PKCS12 keystore that you created when generating a self signed certificate as described in the previous section. You can export the public key using this command against the keystore: | ||
| + | < | ||
| + | openssl pkcs12 -clcerts -nokeys -out <output file> -in < | ||
| + | </ | ||
| + | |||
| + | === 8.4.3. Importing Into OpenAS2 Keystore === | ||
| + | To import certificates contained in the PKCS12 keystore with the help of OpenAS2 command processor (or remote OpenAS2 app): | ||
| + | < | ||
| + | cert import < | ||
| + | </ | ||
| + | |||
| + | It is also possible to use third party keystore manager for this task. Then simply replace existing keystore with the new one (which should contain the new certificates). | ||
| + | |||
| + | IMPORTANT: the file should have the extension " | ||
| + | |||
| + | |||
| + | === 8.4.4. Supporting Multiple Certificates === | ||
| + | |||
| + | The key to supporting multiple certificates for the same partner is ensuring you use a separate '' | ||
| + | |||
| + | === 8.4.5. Overlapping Old And New Certificates When Changing === | ||
| + | |||
| + | Use '' | ||
| + | < | ||
| + | <partner name=" | ||
| + | x509_alias=" | ||
| + | email=" | ||
| + | </ | ||
| + | |||
| + | ... | ||
| + | ==== 8.5. Partner Certificates ==== | ||
| + | |||
| + | The certificate(s) that you will obtain from your partner(s) will need to be imported into the keystore you have created for your own certificate. Your partner should send you the public key for their certificate and should be a single file usually with a " | ||
| + | |||
| + | To import partner public keys into the keystore you can either use: | ||
| + | * the OpenAS2 command interface | ||
| + | * a 3rd party tool | ||
| + | * KeyStore Explorer can do it (I tested it) | ||
| + | |||
| + | === 8.5.1. Replacing Existing Public Keys === | ||
| + | |||
| + | If your partner certificate has expored or is about to expire and they send you a new certificate, | ||
| + | The OpenAS2 command processor (or remote OpenAS2 app) import command for importing your partners certificate would be in this form: | ||
| + | < | ||
| + | cert delete < | ||
| + | </ | ||
| + | |||
| + | === 8.5.2. Importing Public Keys === | ||
| + | |||
| + | The OpenAS2 command processor (or remote OpenAS2 app) import command for importing your partners certificate would be in this form: | ||
| + | < | ||
| + | cert import < | ||
| + | </ | ||
| + | |||
| + | === 8.5.3. Shell Scripts For Certificate Management === | ||
| + | The script uses the Java keytool command and can be found here: | ||
| + | * < | ||
| + | * < | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== 8.6. Possible Issues With Older Certificates ==== | ||
| + | ... | ||
| + | ==== 8.7. Suggested Steps For Certificate Setup ==== | ||
| + | |||
| + | * Do the "My Certificates" | ||
| + | * It is recommended that you create separate certificates per trading partner as this makes it much easier to manage upgrades when the certificate expires as you will only have to coordinate with 1 partner at a time. | ||
| + | |||
| + | |||
| + | === 8.7.1. My Certificates === | ||
| + | |||
| + | ... //Here is described ho to import the own certificates with the help of shell scripts provided with OpenAS2 installation. I think it is possible to do the it with the help of 3rd party tools (like KeyTool Explorer)// | ||
| + | |||
| + | === 8.7.2. Partner Certificates === | ||
| + | |||
| + | ... //Here is described ho to import the partner certificates with the help of shell scripts provided with OpenAS2 installation. I think it is possible to do the it with the help of 3rd party tools (like KeyTool Explorer)// | ||
| + | ===== 9. Logging System ===== | ||
| + | Loggers are configured in the config.xml file using the “loggers” element. | ||
| + | |||
| + | ==== 9.1. Log Output Targets ==== | ||
| + | |||
| + | The logging output can be directed to to multiple destinations including: | ||
| + | * System console | ||
| + | * File system log files | ||
| + | * Email – log messages are emailed to a configured email address. | ||
| + | * Socket – log messages are written to a socket supporting remote logging | ||
| + | * Sentry – support for the Sentry logger that provides logging management for exceptions | ||
| + | |||
| + | === 9.1.1. Console Logger === | ||
| + | The console logger is configured using this entry in the < | ||
| + | < | ||
| + | <logger classname=" | ||
| + | </ | ||
| + | |||
| + | === 9.1.2. File Logger === | ||
| + | The file logger is configured using this entry in the < | ||
| + | < | ||
| + | <logger classname=" | ||
| + | </ | ||
| + | === 9.1.3. Email Logger === | ||
| + | ... | ||
| + | === 9.1.4. Socket Logger === | ||
| + | ... | ||
| + | === 9.1.5. Sentry Logger === | ||
| + | ... | ||
| + | ==== 9.2. Log Level Configuration ==== | ||
| + | |||
| + | ==== 9.3. Log Date Format Configuration ==== | ||
| + | The default format for the timestamp prefixed to all log entries is the international standard including millisecond precision as of version 2.3.1 ('' | ||
| + | The format can be changed by setting the attribute named '' | ||
| + | |||
| + | ==== 9.4. Suppressing Invalid HTTP Request Message ==== | ||
| + | |||
| + | ... | ||
| + | ===== 10. MDN Configuration ===== | ||
| + | MDN's can be sent or received synchronously or asynchronously. | ||
| + | * For sending MDN’s, OpenAS2 will automatically use the mode requested by the sending partner. | ||
| + | * For receiving MDN responses from your partner, the default configuration for a partnership will use the synchronous MDN mode. To set a particular partnership to request the reveiver partner to respond with an asynchronous MDN, the as2_mdn_options and '' | ||
| + | < | ||
| + | < | ||
| + | optional, | ||
| + | < | ||
| + | </ | ||
| + | Per the AS2 specification, | ||
| + | |||
| + | 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 " | ||
| + | |||
| + | The other attribute that must be set is the '' | ||
| + | |||
| + | ==== 10.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: | ||
| + | * '' | ||
| + | * The value set in this attribute will be sent in the " | ||
| + | * For testing using the default config file that comes with the OpenAS2 installation package, set this to: http:// | ||
| + | |||
| + | Receiving an asynchronous MDN requires the " | ||
| + | < | ||
| + | <module classname=" | ||
| + | </ | ||
| + | ==== 10.2. MDN Sender Configuration ==== | ||
| + | |||
| + | Sending an asynchronous or synchronous MDN requires the " | ||
| + | < | ||
| + | <module classname=" | ||
| + | </ | ||
| + | ===== 11. SSL Certificates - Configuring HTTPS Transport ===== | ||
| + | |||
| + | * HTTPS transport using SSL is configured separately for inbound and outbound connectivity. | ||
| + | * You can have both HTTP and HTTPS running concurrently but they must be configured on different ports. | ||
| + | * If you are sending messages to your partner or your partner is using Asynchronous MDN to send messages to you, you do NOT need to obtain SSL certificates from your partner for HTTPS transport – most SSL certificate providers have their trusted certificates installed in the trusted security keystore that comes with your Java installation. | ||
| + | * => so it is not necessary to obtain SSL certificates from aktivbank (because they use only synchronous MDN's and we do not receive AS2 messages from them) | ||
| + | * => TODO: test it | ||
| + | |||
| + | ==== 11.1. SSL Certificates ==== | ||
| + | |||
| + | In order to support inbound HTTP connections over HTTPS to the OpenAS2 application you will | ||
| + | need to set up the SSL certificates. | ||
| + | |||
| + | There are 2 possible inbound connections that can be made to OpenAS2: | ||
| + | * 1. Partner sends files – the request is initiated by the partner and connects to your server | ||
| + | * 2. You send files to a partner but request an ASYNC MDN response in which case the partner initiates the MDN connection to your server to return an MDN after receiving your AS2 message | ||
| + | |||
| + | If you are //NOT using ASYNC MDN mode// for any outbound transfers and you are //NOT receiving any AS2 messages// that require using HTTPS => then you //DO NOT need any SSL certificates// | ||
| + | ==== 11.2. Inbound Transfers ==== | ||
| + | ... | ||
| + | ==== 11.3. Outbound Transfers ==== | ||
| + | |||
| + | The partnership definition for the connection URL to your partners AS2 receiver will also have to be set to the appropriate URL with their host name and prefixed with https: | ||
| + | < | ||
| + | < | ||
| + | ... | ||
| + | < | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | ... | ||
| + | |||
| + | If you are not intending to receive MDN responses over HTTP then disable that module by setting it to " | ||
| + | < | ||
| + | module.AS2MDNReceiverModule.http.enabled=" | ||
| + | </ | ||
| + | |||
| + | * NOTE: If the target system being connected to uses self signed certificates, | ||
| + | < | ||
| + | -Dorg.openas2.cert.TrustSelfSignedCN=< | ||
| + | </ | ||
| + | |||
| + | ===== 12. Running OpenAS2 ===== | ||
| + | |||
| + | ==== 12.1. Starting OpenAS2 ==== | ||
| + | |||
| + | There are 2 executable script files in the bin folder of the AS2 application root: | ||
| + | * 1. start-openas2.sh – for UNIX based systems | ||
| + | * 2. start-openas2.bat – for Microsoft Windows based system | ||
| + | |||
| + | The startup script will create the following folders along with sub folders when it starts assuming no change to the default config: | ||
| + | * logs – contains the normal program logging | ||
| + | * data – contains all the transferred files and any AS2 specific headers associated with AS2 transfers. This folder will have a number of sub folders for outbound and inbound files for different partners | ||
| + | ==== 12.2. Command Entry ==== | ||
| + | |||
| + | Just press < | ||
| + | |||
| + | |||
| + | ==== 12.3. Automated Launching As UNIX Daemon ==== | ||
| + | |||
| + | === 12.3.1. INIT.D Service === | ||
| + | |||
| + | === 12.3.2. SYSTEMD Service === | ||
| + | |||
| + | |||
| + | ==== 12.4. Windows Service Management ==== | ||
| + | |||
| + | === 12.4.1. Installing Service === | ||
| + | |||
| + | === 12.4.2. Removing Service === | ||
| + | |||
| + | === 12.4.3. Troubleshooting Windows Service === | ||
| + | |||
| + | |||
| + | ===== 13. Testing OpenAS2 Transfers ===== | ||
| + | |||
| + | ==== 13.1. Single Instance Testing ==== | ||
| + | |||
| + | The default configuration of the OpenAS2 configuration is set up for three partners named: | ||
| + | * MyCompany | ||
| + | * PartnerA | ||
| + | * PartnerB | ||
| + | * However, PartnerB does not have a certificate set up so cannot be actively used unless you create and import a certificate for that partner. | ||
| + | |||
| + | |||
| + | In the default configuration: | ||
| + | * To send something to PartnerA simply put the file, that should be sent to the folder ''< | ||
| + | * In my case: '' | ||
| + | ==== 13.2. Multiple Instance Testing ==== | ||
| + | |||
| + | ==== 13.3. Using HTTPS Transport ==== | ||
| + | |||
| + | |||
| + | ===== 14. Troubleshooting OpenAS2 ===== | ||
| + | |||
| + | |||
| + | 14.1. Canonicalization For MIC Algorithm | ||
| + | 14.2. Binary Encoding | ||
| + | 14.3. HTTP Restricted Headers | ||
| + | 14.4. CMS Algorithm Protection | ||
| + | 14.5. Content Length Versus Chunked | ||
| + | 14.6. SSL Certificate Exceptions | ||
| + | 14.7. Java Versions Prior To 1.7 | ||
| + | 14.8. Mime Body Part Logging | ||
| + | 14.9. TLSv1.2 | ||
| + | 14.10. HTTP Read Timeout Errors | ||
| + | 14.11. Out Of Memory And File Size Issues | ||
| + | 14.12. File System Issues | ||
| + | 14.13. Header Folding | ||
| + | |||
| + | ===== 15. Partner AS2 Compatibility Settings ===== | ||
| + | |||
| + | |||
| + | ===== 16. Remote Control ===== | ||
| + | |||
| + | ==== 16.1. Socket Command Processor ==== | ||
| + | |||
| + | === 16.1.1. Server Side Configuration === | ||
| + | |||
| + | === 16.1.2. Client Side Configuration === | ||
| + | |||
| + | === 16.1.3. Running on deployed server === | ||
| + | |||
| + | === 16.1.4. Running on a separate server === | ||
| + | |||
| + | === 16.1.5. Commands === | ||
| + | |||
| + | |||
| + | ==== 16.2. REST API Command Processor ==== | ||
| + | |||
| + | === 16.2.1. Server Side Configuration === | ||
| + | |||
| + | === 16.2.2. Using the REST API === | ||
| + | |||
| + | |||
| + | ===== 17. Dynamic Variables ===== | ||
| + | |||
| + | ===== 18. Appendix: config.xml file structure ===== | ||
| + | |||
| + | ===== 19. Appendix: partnership.xml file structure ===== | ||
| + | |||
| + | ===== 20. Appendix: command.xml file structure ===== | ||
| + | |||
| + | ===== 21. Appendix: Updating database structure ===== | ||
| + | |||
| + | ===== 22. Appendix: Creating database DDL for external databases ===== | ||
| + | |||
| + | ===== 23. Appendix: Upgrading ===== | ||
| + | |||
| + | ===== 24. Appendix: Clustering and Load Balancing ===== | ||
| + | |||
| + | ===== 25. Appendix: Maven Artifacts ===== | ||
| + | |||
| + | |||
