FIXS Stunnel Implementation Guide For FIX Applications v1.0
FIXS Stunnel Implementation Guide For FIX Applications v1.0
Revision 1.0
DISCLAIMER
NO PERSON OR ENTITY ASSOCIATED WITH THE FIX PROTOCOL SHALL HAVE ANY
LIABILITY FOR DAMAGES OF ANY KIND ARISING IN ANY MANNER OUT OF OR IN
CONNECTION WITH ANY USER'S USE OF (OR ANY INABILITY TO USE) THE FIX
PROTOCOL, WHETHER DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR
CONSEQUENTIAL (INCLUDING, WITHOUT LIMITATION, LOSS OF DATA, LOSS OF
USE, CLAIMS OF THIRD PARTIES OR LOST PROFITS OR REVENUES OR OTHER
ECONOMIC LOSS), WHETHER IN TORT (INCLUDING NEGLIGENCE AND STRICT
LIABILITY), CONTRACT OR OTHERWISE, WHETHER OR NOT ANY SUCH PERSON
OR ENTITY HAS BEEN ADVISED OF, OR OTHERWISE MIGHT HAVE ANTICIPATED
THE POSSIBILITY OF, SUCH DAMAGES.
No proprietary or ownership interest of any kind is granted with respect to the FIX Protocol (or
any rights therein).
Copyright 2018 FIX Protocol Limited, all rights reserved.
Table of Contents
1 Introduction .......................................................................................................................................... 6
1.1 Overview.................................................................................................................................... 6
1.2 FIX and TLS Roles ....................................................................................................................... 6
1.2.1 Deployment........................................................................................................................... 6
1.3 Scope ......................................................................................................................................... 8
1.3.1 Out of scope .......................................................................................................................... 8
1.4 References ................................................................................................................................. 8
1.4.1 Versions and Updates ........................................................................................................... 8
2 Overview of Stunnel Options ................................................................................................................ 9
2.1 Connectivity ............................................................................................................................... 9
2.1.1 Client ..................................................................................................................................... 9
2.1.2 Server .................................................................................................................................. 10
2.1.3 IP Address or Domain Name ............................................................................................... 10
2.1.4 Socket Options .................................................................................................................... 10
2.2 TLS Version .............................................................................................................................. 10
2.3 Cipher Suites............................................................................................................................ 10
2.3.1 Cipher suites for use with certificates............................................................................. 11
2.3.1 Cipher suites for use with pre-shared keys..................................................................... 11
2.4 Authentication Methods ......................................................................................................... 12
2.4.1 Public Key Infrastructure (PKI) ............................................................................................ 12
2.4.2 Pre-shared Key Authentication ........................................................................................... 14
2.5 Platform-specific configuration ............................................................................................... 14
2.5.1 Windows ............................................................................................................................. 14
2.6 Local Administration................................................................................................................ 15
2.6.1 Configuration file ................................................................................................................ 15
2.6.2 Local security....................................................................................................................... 15
2.6.3 Logging ................................................................................................................................ 15
3 Use Cases ............................................................................................................................................ 15
3.1 Service defaults ....................................................................................................................... 15
3.1.1 TLS version .......................................................................................................................... 15
3.1.2 Cipher suites........................................................................................................................ 15
3.2 Mutual authentication using certificates ................................................................................ 16
3.2.1 Server Configuration ........................................................................................................... 16
3.2.2 Client Configuration ............................................................................................................ 16
3.3 Using Pre-Shared keys ............................................................................................................. 17
3.3.1 Server Configuration ........................................................................................................... 17
3.3.2 Client Configuration ............................................................................................................ 17
Document History
Revision Date Author Revision Comments
0.1 4/14/2017 Don Mendelson DRAFT revision 1
Silver Flash LLC
0.2 4/21/2017 Don Mendelson DRAFT revision 2
Silver Flash LLC
0.3 6/02/2017 Don Mendelson DRAFT revision 3
Silver Flash LLC
Vladimir Coxall
Itiviti USA
0.4 7/06/2017 Don Mendelson DRAFT revision 4
Silver Flash LLC
0.5 7/17/2017 Don Mendelson DRAFT revision 5
Silver Flash LLC
0.6 7/25/2017 Don Mendelson DRAFT revision 6
Silver Flash LLC
1.0 1/24/2018 Alex Pollard Updated to "Final" revision
GTC PM
1 Introduction
1.1 Overview
This guide is a supplement to the FIXS Technical Standard for usage of Stunnel. Stunnel is a
proxy for Transport Layer Security (TLS) communications. This guide is intended to cover use
cases where an application is FIX-protocol aware but either does not have TLS capabilities or for
which it is desirable to offload TLS operations to a proxy. One motivation for using a proxy is to
terminate external communications in a DMZ subnetwork while protecting applications such as
FIX engines within an internal local area network. The communications between the proxy and
the FIX engine can then flow over an ordinary TCP transport.
Note: many of the names associated with secure sockets still contain “SSL”, but the SSL
protocol has been superseded by TLS.
1.2.1 Deployment
Stunnel is distributed as an executable for Windows, Android or Linux. Downloads are available
at https://www.stunnel.org/downloads.html. The software-only implementation depends on
OpenSSL, available in GitHub as source at https://github.com/openssl/openssl. Hardware
implementations of encryption engines are also available from product vendors.
A local FIX engine may be configured for one or more FIX sessions. By using Stunnel, the FIX
application needs no knowledge of TLS or cryptographic keys, yet its communications to the
remote host is secure. All the TLS configuration is in Stunnel.
1.3 Scope
The guide is limited to the protocol stack of FIX over TCP/IP with TLS and does not cover every
feature of Stunnel. This guide makes recommendations about Stunnel configurations that
promote security and interoperability on the wire.
This configuration guide applies mainly to software implementation of TLS mostly commonly
used with Stunnel, which is the OpenSSL library.
1.4 References
FIX-over-TLS (FIXS) Technical Standard Requirements and Guidance 2016, FIX Protocol Ltd.
Stunnel: Documentation, https://www.stunnel.org/docs.html. Software author: Michał Trojnara.
Note that Stunnel is free software but is not open source; the author retains the copyright.
OpenSSL:Documentation, https://www.openssl.org/docs/ Cryptography and SSL/TLS Toolkit
used by stunnel. Free and open source. The OpenSSL toolkit stays under a double license, i.e.
both the conditions of the OpenSSL License and the original SSLeay license apply to the toolkit.
It is up to individual firms to decide whether software and licenses are suitable for their needs.
protocol=connect
verifyChain
verifyPeer
2.1 Connectivity
2.1.1 Client
The connect option is used to specify a remote server address for client connectivity.
connect = <[HOST:]PORT>
2.1.2 Server
The accept option is used listen for connections by clients.
accept = [HOST:]PORT
If host is not supplied, then the server listens to the specified port on all network interfaces.
The list of enabled cipher suites is transmitted from client to server in the order that they are
configured in Stunnel, and in accordance with the TLS protocol, the list is in order of preference.
The server will accept the most preferred cipher suite that it has in common with the client.
OpenSSL uses non-standard cipher suite names for configuration. Each name is a combination
key exchange, encryption and message digest algorithms. (Within the TLS protocol, cipher suites
are designated on the wire by a two-byte code, not the names listed below. Although its
configuration names are non-standard, OpenSSL translates its names to the standard codes. See
1
NTLM authentication is also supported on Windows only.
The private key may be stored in the same file as the certificate. Alternatively, the corresponding
private key may be stored in its own file:
key = <KEY_FILE>
This option is implied by verifyChain or verifyPeer as described below, but it is not an error
if requireCert is also present in those cases.
Additionally, one of the following options must be provided with verifyChain to tell the
location of Certificate Authority certificates. The directory /etc/ssl/certs is the
conventional location of a hashed directory containing trusted CA certificates.
CApath = <CA_DIRECTORY>
Or
Optionally, one or more of the following settings may be added to verify the subject of the
certificate, either by host name, IP address or email address:
checkEmail = <EMAIL>
checkHost = <HOST>
checkIP = <IP>
More than one address may be configured. A certificate is verified successfully if there is at least
one subject match.
The verifyPeer option implies requireCert = yes. The verifyPeer option should be used
with one of the methods described below to activate a check for revoked certificates.
Due to the difficulty of maintain current CRLs for all possible peers and their CAs, it is
recommended that OCSP be used instead (see below).
The primary use of AIA extension is to fetch missing intermediate certificates in a chain of trust.
chroot = <DIRECTORY>
2.6.3 Logging
On UNIX, Stunnel logs to Syslog by default. The default log level is “notice”, but it may be
overridden with debug = <LEVEL>.
Logging may be directed to a file as follows (required on Windows):
output = /usr/local/var/log/stunnel.log
3 Use Cases
See the main FIX-over-TLS document for a full explanation of the use cases described below.
sslVersion = TLSv1.2
[fix-server]
; Listen port for TLS connection from client
accept = 0.0.0.0:7777
; TCP connection to local FIX engine in the form host:port
connect = 127.0.0.1:3003
cert = /etc/stunnel/stunnel-5.41/stunnel.pem
verifyPeer = yes
CAfile = /etc/ssl/certs/stunnel2.pem
ciphers = DHE-RSA-AES128-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-
AES256-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-
SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-
ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-GCM-
SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384
sslVersion = TLSv1.2
4 Appendix
The following utilities are helpful to manage certificates used by Stunnel.