How to setup secure SSL/TLS connесtion between FIXEdge, FIXICC-agent and FIXICC
- 1 Overview
- 2 Enabling SSL/TLS connection in java applications (FIXICC GUI, FIXICC-agent)
- 3 SSL/TLS Connection Configuration
- 3.1 Enable SSL connections between FIXICC-agent and FIXICC GUI
- 3.1.1 FIXICC-agent side. Accept SSL connections.
- 3.1.1.1 agent.properties
- 3.1.1.2 wrapper.conf
- 3.1.2 FIXICC GUI side. Establish SSL connections.
- 3.1.2.1 fixengine.properties
- 3.1.2.2 fixicc.conf
- 3.1.1 FIXICC-agent side. Accept SSL connections.
- 3.2 Enable SSL connections between FIXICC-agent and FIXEdge (Version 1)
- 3.2.1 FIXICC-agent side. Establish SSL connection to FIXEdge
- 3.2.1.1 fixengine.properties
- 3.2.1.2 agent.properties
- 3.2.1.3 wrapper.conf
- 3.2.2 FIXEdge side. Accept SSL connection from FIXICC-agent
- 3.2.2.1 engine.properties
- 3.2.1 FIXICC-agent side. Establish SSL connection to FIXEdge
- 3.3 Enable SSL connections between FIXICC-agent and FIXEdge (Version 2)
- 3.4 Enable SSL connections between FIXICC-agent and LDAP service
- 3.5 Enable SSL connections between FIXEdge and FIX-clients
- 3.6 Enable SSL connections between FIXEdge and LDAP service
- 3.1 Enable SSL connections between FIXICC-agent and FIXICC GUI
- 4 Troubleshooting
Overview
This article shows how to configure a secure connection between FIXEdge's parties as on a diagram below:
FIXEdge side. Establish SSL connection to LDAP service (out of scope)
LDAP Service side. Accept connection from FIXEdge (out of scope)
LDAP Service side. Accept connection from FIXICC-agent (out of scope)
FIXEdge uses OpenSSL for a secure connection.
FIXICC and FIXICC-agent package includes and run on JRE 1.8.x. Java Virtual Machine determines which secure layer to use, in Java 8 it is TLS 1.2 by default.
This article doesn't describe how to configure SSL connections on LDAP and FIX Sessions sides.
Enabling SSL/TLS connection in java applications (FIXICC GUI, FIXICC-agent)
In order to establish SSL/TLS connection between two java applications, one can use KeyStores and TrustStores:
KeyStore is used for storing of private keys and certificates. It's commonly used on the server-side.
TrustStore is used for storing trusted certificates and public keys for trusted certificate authorities CA and self-signed certificates. It's commonly used on the client-side.
keytool is a official java tool for keys and certificates management. Here is an example of how to create these storages by using keytool that is part of J2SE SDK(http://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html).
Manage KeyStores and TrustStores
The following steps allow creating necessary containers for certificates and keys which would be used for establishing SSL Connections between applications.
Create KeyStore with the certificate
Create a new KeyStore containing a certificate and a private key.
keytool -keystore fixiccKeystore.key -genkey -alias fixiccNote:
sslKeystoreKeyAlias is case-sensitive, but the Keytool saves upper case letters to the alias only when parameter -storetype CaseExactJKS is given while creating the KeyStore.
The program will ask for certificate owner information and request to enter a password for the KeyStore.
fixiccKeystore.key - is a resulted KeyStore file.
The further commands and configuration contain <keystore_password> as a placeholder for the password.
Export certificate from KeyStore
Export the public certificate using keytool.
keytool -export -keystore fixiccKeystore.key -alias fixicc -rfc -file fixicc.cerThe program will request a password <keystore_password> for fixiccKeystore.key which was entered during "Create KeyStore with the certificate" step.
Import certificate to TrustStore
Import public certificate to TrustStore
keytool -import -file fixicc.cer -alias fixiccUI -keystore fixiccTrustStore.keyThe program will ask for a new password for Trust store and if the certificate is trusted.
The further commands and configuration contain <truststore_password> as a placeholder for the password.
SSL/TLS Connection Configuration
Enable SSL connections between FIXICC-agent and FIXICC GUI
FIXICC-agent side. Accept SSL connections.
Enable SSL connections in agent.properties:
agent.properties
AgentServerEnableSSL=true Use private key and certificate from KeyStore. Pass additional JVM parameters as wrapper parameters in wrapper.conf:
wrapper.conf
wrapper.java.additional.3=-Djavax.net.ssl.keyStore=${wrapper_home}/FIXEdge1.fixicc-agent/conf/fixiccKeystore.key
wrapper.java.additional.4=-Djavax.net.ssl.keyStorePassword=<keystore_password>where
${wrapper_home}/FIXEdge1.fixicc-agent/conf/fixiccKeystore.key - the path to keyStore
<keystore_password> - the password for keyStore
FIXICC GUI side. Establish SSL connections.
Enable SSL connections in fixengine.properties
fixengine.properties
enableSSL=trueUse certificate from TrustStore for establishing a connection. Pass additional JVM parameters as 'default_options' parameters in fixicc.conf:
fixicc.conf
default_options="<OTHER_PRAMETERS> -J-Djavax.net.ssl.trustStore=etc/fixiccTrustStore.key -J-Djavax.net.ssl.trustStorePassword=<truststore_password>"where
etc/fixiccTrustStore.key - the path to trustStore
<truststore_password> - the password for trustStore
Enable SSL connections between FIXICC-agent and FIXEdge (Version 1)
This version of configuration is based on instructing FIXICC Agent to use FIXEdge's ListenSSLPort to connect.
FIXICC-agent side. Establish SSL connection to FIXEdge
Enable SSL initiator connections in fixengine.properties:
fixengine.properties
enableSSL=trueSet remote port parameter name in fixicc-agent to SSL port configured in FIXEdge that should be used for SSL connection (i.e. ListenSSLPort from engine.properties)
agent.properties
EngineProperty.AdminSessionPort = ListenSSLPortImport FIXEdge public certificate (see SSLCertificate parameter value from engine.properties) to TrustStore
keytool -import -file fixedge.crt -alias fixedgeSrv -keystore fixiccTrustStore.keyUse certificate from TrustStore for establishing a connection. Pass additional JVM parameters as wrapper parameters in wrapper.conf
wrapper.conf
wrapper.java.additional.5=-Djavax.net.ssl.trustStore=${wrapper_home}/FIXEdge1.fixicc-agent/conf/fixiccTrustStore.key
wrapper.java.additional.6=-Djavax.net.ssl.trustStorePassword=<truststore_password>where
${wrapper_home}/FIXEdge1.fixicc-agent/conf/fixiccTrustStore.key - the path to trustStore
<truststore_password> - the password for trustStore
FIXEdge side. Accept SSL connection from FIXICC-agent
Enable SSL connections in engine.properties:
engine.properties
ListenSSLPort = 8905
SSLCertificate = FIXEdge1/conf/cert.pem
SSLPrivateKey = FIXEdge1/conf/key.pem
SSLProtocols = TLSv1_2where
FIXEdge1/conf/cert.pem - certificate
FIXEdge1/conf/key.pem - private.key
For key and cert files please set required privileges: FIXEdge installation with the principle of least privilege on Linux
For details please refer to:
Enable SSL connections between FIXICC-agent and FIXEdge (Version 2)
This second version is based on Monitoring.Listen port usage on FIXEdge side. Secure connection in this case is achieved by setting Monitoring.ListenPort equal to ListenSSLPort
FIXICC-agent side. Establish SSL connection to FIXEdge
Enable SSL initiator connections in fixengine.properties:
fixengine.properties
enableSSL=trueImport FIXEdge public certificate (see SSLCertificate parameter value from engine.properties) to TrustStore
keytool -import -file fixedge.crt -alias fixedgeSrv -keystore fixiccTrustStore.keyUse certificate from TrustStore for establishing a connection. Pass additional JVM parameters as wrapper parameters in wrapper.conf
wrapper.conf
wrapper.java.additional.5=-Djavax.net.ssl.trustStore=${wrapper_home}/FIXEdge1.fixicc-agent/conf/fixiccTrustStore.key
wrapper.java.additional.6=-Djavax.net.ssl.trustStorePassword=<truststore_password>where
${wrapper_home}/FIXEdge1.fixicc-agent/conf/fixiccTrustStore.key - the path to trustStore
<truststore_password> - the password for trustStore
FIXEdge side. Accept SSL connection from FIXICC-agent
Enable SSL connections in engine.properties:
engine.properties
ListenSSLPort = 8905
SSLCertificate = FIXEdge1/conf/cert.pem
SSLPrivateKey = FIXEdge1/conf/key.pem
SSLProtocols = TLSv1_2
Monitoring.ListenPort = 8905where
FIXEdge1/conf/cert.pem - certificate
FIXEdge1/conf/key.pem - private.key
For key and cert files please set required privileges: FIXEdge installation with the principle of least privilege on Linux
For details please refer to:
Enable SSL connections between FIXICC-agent and LDAP service
FIXICC-agent side. Establish SSL connection to LDAP service
Enable SSL initiator connections in fixengine.properties:
fixengine.properties
enableSSL=trueImport LDAP server public certificate to TrustStore
keytool -import -file ldap.crt -alias ldapSrv -keystore fixiccTrustStore.keyUse certificate from TrustStore for establishing a connection. Pass additional JVM parameters as wrapper parameters in wrapper.conf
wrapper.conf
wrapper.java.additional.7=-Djavax.net.ssl.trustStore=${wrapper_home}/FIXEdge1.fixicc-agent/conf/fixiccTrustStore.key
wrapper.java.additional.8=-Djavax.net.ssl.trustStorePassword=<truststore_password>where
${wrapper_home}/FIXEdge1.fixicc-agent/conf/fixiccTrustStore.key - the path to trustStore
<truststore_password> - the password for trustStore
LDAP Service side. Accept connection from FIXICC-agent
Out of the scope of this article.
Enable SSL connections between FIXEdge and FIX-clients
Information can be found in the articles:
In case if FIX Client doesn't have SSL support in the applications, proxies application like STunnel can be used for it.
See an example of the configuration here: How to configure stunnel to enable SSL for FIX session#InitiatorFIXsession
Enable SSL connections between FIXEdge and LDAP service
Out of the scope of this article.
Troubleshooting
FIXICC-agent. SSL debugging
wrapper.conf
wrapper.java.additional.9=-Djavax.net.debug=sslAfter setting up configuration you need to restart the FIXICC Agent. Please check the log file and make sure that the FIXICC Agent started without errors.
Unknown error
To get the reason of unknown errors like below:
error:1408A0C1:lib(20):func(138):reason(193). Unknown error 336109761. (Error code = 336109761)run openssl application for error number 1408A0C1
openssl errstr 1408A0C1or check the error code meaning reason(193). e.g.: on site
FIXEdge rejects SSL connection from FIXICC-agent
The administrative session from FIXICC-agent is rejected when it is trying to connect over SSL to SSL port with reason:
FixEdge.log
Administrative client is rejected: connect port of the client (8905) is different from expected (8900).where:
8905 - port accepting SSL connection. See ListenSSLPort parameter.
8900 - target port for FIXICC-agent administration session defined in EngineProperty.AdminSessionPort parameter in agent.properties. See FIXICC-agent side. Establish SSL connection to FIXEdge for details.
It can be solved with removing, commenting the property Monitoring.ListenPort in engine.properties or setting it equal to ListenSSLPort (see Enable SSL connections between FIXICC-agent and FIXEdge (Version2))
In case of removing (commenting) Monitoring.ListenPort accepting connections of administrative sessions to this port stops to work. Non SSL admistrative sessions can be connected to ports from ListenPort parameter in engine.properties.
An example of error output in FIXEdge or FIX Antenna logs:
FixEdge.log
<time> Severity=INFO Category=Engine Incoming TCP connection was detected (from 127.0.0.1:56896).
<time> Severity=WARN Category=Engine Session <FIXADMIN, AdminClient> : Error during processing Logon message from 127.0.0.1:56896: Administrative client is rejected: connect port of the client (8905) is different from expected (8900).
<time> Severity=INFO Category=Engine Incoming TCP connection was closed (from 127.0.0.1:56896).An example of error output in FIXICC-agent logs: