Encrypting Connections
TigerGraph supports secure data-in-flight communication, using SSL/TLS encryption protocol. This applies to any outward-facing channel, including GSQL clients, RESTPP endpoints, and the GraphStudio web interface. When SSL/TLS is enabled, HTTPS takes the place of HTTP for RESTPP and GraphStudio connections.

Prerequisites

You should have basic knowledge about how SSL works:
  1. 1.
    What the SSL certificate and key are used for
  2. 2.
    That an SSL certificate is bound to a domain
  3. 3.
    How an SSL certificate chain works
A good primer on SSL is available to https://httpd.apache.org/docs/2.4/ssl/ssl_intro.html

Nginx-Based

TigerGraph uses the Nginx web server, so SSL configuration makes use of some built-in support in Nginx.

Step 1. Obtain an SSL Certificate

The two main options for obtaining an SSL Certificate are to generate your own self-signed certificate or to purchase a certificate from a trusted Certificate Authority. Regardless of which method you choose, your certificate should be chained to a trusted root certificate embedded in your browser. The options and details for producing a trusted SSL certificate are beyond the scope of this document. The focus of this document is how to configure your TigerGraph system to use the certificate to enable SSL.

Option 1: Using a Certificate From A Trusted Agent

First, obtain an SSL certificate from a trusted agent of your choice. Certificate vendors will provide clear instructions for ordering a certificate and then for installing it on your system.
Then you can configure the certificate with gadmin config entry ssl

Option 2: Create a Self-Signed Certificate

There are multiple ways to create a self-signed certificate. One example is shown below.
For simplicity, the method below will use the root certificate directly as the HTTPS server certificate. This method is satisfactory for testing but should not be used for a production system.
In the example below, the Common Name value should be your server hostname, since HTTPS certificates are bound to domain names.
Self-Signed Certificate generation example using openssl
1
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ~/nginx-selfsigned.key -out ~/nginx-selfsigned.crt
2
3
Generating a 2048 bit RSA private key
4
.................................................................................................................................+++
5
........+++
6
writing new private key to '/home/tigergraph/nginx-selfsigned.key'
7
-----
8
You are about to be asked to enter information that will be incorporated
9
into your certificate request.
10
What you are about to enter is what is called a Distinguished Name or a DN.
11
There are quite a few fields but you can leave some blank
12
For some fields there will be a default value,
13
If you enter '.', the field will be left blank.
14
-----
15
Country Name (2 letter code) [AU]:US
16
State or Province Name (full name) [Some-State]:California
17
Locality Name (eg, city) []:Redwood City
18
Organization Name (eg, company) [Internet Widgits Pty Ltd]:TigerGraph
19
Organizational Unit Name (eg, section) []:GLE
20
Common Name (e.g. server FQDN or YOUR name) []: my.ip.addr.num
21
Email Address []:[email protected]
Copied!

Change the Certificate Permission

For security reasons, the certificates can only be used with permission 600 or less.
1
$ chmod 600 ~/nginx-selfsigned.*
Copied!

Step 2: Configure SSL with gadmin

With the self-signed certificate successfully generated, you can configure it with gadmin, so that all the HTTP traffic will be protected with SSL.
TigerGraph's SSL only accepts PEM-encoded certificates. If you have a certificate encoded in other formats (e.g. DER), you need to convert it to a PEM-encoded certificate first.
1
$ gadmin config entry ssl
2
3
​Nginx.SSL.Enable [ false ]: Enable SSL connection for all HTTP requests
4
New: true
5
6
Nginx.SSL.Key [ <masked> ]: Private key for SSL
7
New: @privateKey_file_path
8
9
Nginx.SSL.Cert [ <masked> ]: Public certificate for SSL
10
New: @ssl_cert_path
11
12
# This config (Nginx.ProxySSLVerify) was removed in v3.1.1
13
Nginx.ProxySSLVerify [ false ]: Enable verification of the proxied HTTPS server certificate. Recommend to turn on.
14
New: true
Copied!
After saving the settings, apply the configuration settings.
1
gadmin config apply -y
2
3
[ Info] Successfully applied configuration change. Please restart services to make it effective immediately.
Copied!
Then restart the following services: gsql, nginx, ts3, and gui.
1
$ gadmin restart gsql nginx gui ts3 -y
Copied!

Testing Your SSL Connection

Now you may test the connection.
A direct curl request to the server will fail due to certificate verification failure:
1
$ curl https://localhost:14240
2
3
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
4
More details here: http://curl.haxx.se/docs/sslcerts.html
5
6
curl performs SSL certificate verification by default, using a "bundle"
7
of Certificate Authority (CA) public keys (CA certs). If the default
8
bundle file isn't adequate, you can specify an alternate file
9
using the --cacert option.
10
11
If this HTTPS server uses a certificate signed by a CA represented in
12
the bundle, the certificate verification probably failed due to a
13
problem with the certificate (it might be expired, or the name might
14
not match the domain name in the URL).
15
16
If you'd like to turn off curl's verification of the certificate, use
17
the -k (or --insecure) option.
Copied!
In v1.2, the default TCP/IP port for Nginx has changed from 44240 to 14240, to avoid possible port conflicts with Zookeeper.
You may use the -k option to turn off the verification, but it is unsafe and not recommended.
To successfully make requests with curl, you will need to specify the certificate by using the --cacert parameter:
1
$ curl --cacert /home/tigergraph/nginx-selfsigned.crt https://localhost:14240
2
3
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>GraphStudio</title><base href="/"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico"><link href="styles.d67299ba9f5d73aecbe2.bundle.css" rel="stylesheet"/></head><body class="mat-typography"><app-root></app-root><script type="text/javascript" src="inline.4aae6a8088c30a61d5b0.bundle.js"></script><script type="text/javascript" src="polyfills.c9b879328f3396b2bbe8.bundle.js"></script><script type="text/javascript" src="vendor.5392e4ea4f904cd1658c.bundle.js"></script><script type="text/javascript" src="main.a39087227fcdf478cd2a.bundle.js"></script></body></html>
Copied!