How TLS/SSL Works with the Gateway

You can secure network traffic between Kaazing Gateway and its clients and back-end servers using the widespread networking protocol Transport Layer Security (TLS, also known as SSL). TLS/SSL is the protocol you use when accessing secure websites with a URL that begins with https://. TLS/SSL protects data from modification during transit and verifies its authenticity. WebSocket connections are secured by tunneling through TLS/SSL using the WebSocket Secure (WSS) URL scheme wss://. By securing Gateway communication with TLS/SSL, you protect the confidentiality, integrity, and availability of your network communications.

In addition, configuring the Gateway with TLS/SSL ensures that network intermediaries, such as transparent proxy servers and firewalls that are unaware of WebSocket, do not drop the WebSocket connection. WebSocket uses the same HTTP upgrade method commonly used to upgrade HTTP connections to HTTPS. Intermediaries unfamiliar with WebSocket might drop the unfamiliar WebSocket upgrade as a security precaution, preventing the WebSocket connection. When using the WSS connection over TLS/SSL, however, intermediaries trust the connection and allow it to pass.

Important:

the Gateway uses TLS to secure network traffic with clients and back-end servers

Figure: The Gateway Uses one TLS/SSL Certificate to Secure Network Traffic With Clients and a Separate TLS/SSL Certificate to Secure Network Traffic With Back-end Servers

If you are new to network security and TLS/SSL, see Transport Layer Security (TLS/SSL) Concepts.

Common Configurations with the Gateway

The following two TLS/SSL configurations are the most common with the Gateway, and the focus of this guide:

Before you perform the steps in either scenario, review Components and Tools and TLS/SSL with the Gateway Example, to learn how to:

Notes:

Components and Tools

Before you get started, review the components and tools used to configure TLS/SSL with the Gateway, described in the following table:

Component Description
The Gateway and its configuration file (gateway-config.xml) You will configure the Gateway configuration file (GATEWAY_HOME/conf/gateway-config.xml) for secure networking between the Gateway and clients and the Gateway and back-end servers. For more information on gateway-config.xml, see About Kaazing Gateway Configuration Files.
host names Each certificate you use for secure networking is created for use with a specific host name. The certificate used for the client connection to the Gateway uses the host name of the Gateway, and the certificate used for the back-end server connection uses the host name of the back-end server. These host names must be resolvable using DNS.
public keys The certificates used by a client to establish trust with the Gateway, or by the Gateway to establish trust with a back-end server. The certificates contain the public keys needed for encrypting data.
private keys The private keys used by the Gateway to decrypt data sent from clients, and by the back-end servers to decrypt data sent by the Gateway.
certificates Two certificates are used for secure networking with the Gateway: one certificate for the client-to-Gateway connection, and one certificate for the Gateway-to-back-end server connection.
keystore (for example, keystore.db) Contains the certificates presented to clients by the Gateway when clients connect to the Gateway over TLS/SSL. These are the certificates trusted by the clients. The file is located in the GATEWAY_HOME/conf folder.
keystore password (for example, keystore.pw) The password used by the Gateway to access the keystore is stored in this file, located in the GATEWAY_HOME/conf folder.
truststore (for example, truststore.db) Contains the certificates used by the Gateway when the Gateway is acting as a client of back-end servers. These are the certificates trusted by the Gateway. This file is located in the GATEWAY_HOME/conf folder.
keytool The command-line tool used to create, list, import, and export certificates for use with the Gateway. The Java keytool utility is part of your Java installation and is located in the Java bin directory. For example, C:\Program Files\Java\jre6\bin (Windows) or /Library/Java/home/bin (Mac OS X).
clients (web browsers and client applications) The client-side user agents that participate in secure networking with the Gateway, including web browsers and client applications using HTTPS and WSS.
back-end servers The back-end servers that participate in secure networking with the Gateway.

TLS/SSL with the Gateway Example

The following is an overview of what happens under-the-hood when TLS/SSL is used for a Gateway proxy connection between a client and a back-end server, and when TLS/SSL is enabled on both the Gateway and the back-end server:

  1. The client connects to the Gateway using the secure URL wss://example.com:9000/.
  2. The Gateway accepts the WSS URL as part of its proxy configuration and looks in its gateway-config.xml file for the keystore file that contains the certificate for example.com (and the keystore’s corresponding password file). The Gateway gets the certificate (containing the public key) for example.com and sends it to the client.
  3. The client verifies and accepts the Gateway digital certificate for example.com. The TLS/SSL handshake occurs, and the client is in secure communication with the Gateway using WSS. The client uses the same certificate for future connections until the certificate expires.
  4. The Gateway prepares to connect to the back-end server using the connect URL ssl://offline.example.com:61617.
  5. The Gateway checks its truststore to see if it has a trusted certificate for offline.example.com.
  6. The Gateway verifies the certificate for offline.example.com (for example, examines its expiry date), connects to the back-end server using the certificate and the TLS/SSL handshake between the Gateway and back-end server occurs. The Gateway uses the same certificate for future connections until the certificate expires.
  7. The Gateway establishes a secure connection with the back-end server over TLS/SSL. Secure networking is now established between the client and the Gateway over WSS and the Gateway and the back-end server over TLS/SSL. All network traffic is transmitted securely.

See Also