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.
You should have basic knowledge about how SSL works:
What the SSL certificate and key are used for
That an SSL certificate is bound to a domain
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
TigerGraph uses the Nginx web server, so SSL configuration makes use of some built-in support in Nginx.
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.
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 --configure ssl
There are multiple ways to create a self-signed certificate. One example is shown below.
Self-Signed Certificate generation example using openssl$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ~/nginx-selfsigned.key -out ~/nginx-selfsigned.crtGenerating a 2048 bit RSA private key.................................................................................................................................+++........+++writing new private key to '/home/tigergraph/nginx-selfsigned.key'-----You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter '.', the field will be left blank.-----Country Name (2 letter code) [AU]:USState or Province Name (full name) [Some-State]:CaliforniaLocality Name (eg, city) :Redwood CityOrganization Name (eg, company) [Internet Widgits Pty Ltd]:TigerGraphOrganizational Unit Name (eg, section) :GLECommon Name (e.g. server FQDN or YOUR name) : my.ip.addr.numEmail Address :[email protected]
For security reasons, the certificates can only be used with permission 600 or less.
$ chmod 600 ~/nginx-selfsigned.*
With the self-signed certificate successfully generated, you can configure it with
gadmin, so that all the HTTP traffic will be protected with SSL.
$ gadmin config entry sslNginx.SSL.Enable [ false ]: Enable SSL connection for all HTTP requestsNew: trueNginx.SSL.Key [ <masked> ]: Private key for SSLNew: @privateKey_file_pathNginx.SSL.Cert [ <masked> ]: Public certificate for SSLNew: @ssl_cert_pathNginx.ProxySSLVerify [ false ]: Enable verification of the proxied HTTPS server certificate. Recommend to turn on.New: true
After saving the settings, apply the configuration settings.
gadmin config apply -y[ Info] Successfully applied configuration change. Please restart services to make it effective immediately.
Then restart the external-facing services: gsql, nginx, and gui.
$ gadmin restart gsql nginx gui -y
Now you may test the connection.
A direct curl request to the server will fail due to certificate verification failure:
$ curl https://localhost:14240curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: noneMore details here: http://curl.haxx.se/docs/sslcerts.htmlcurl performs SSL certificate verification by default, using a "bundle"of Certificate Authority (CA) public keys (CA certs). If the defaultbundle file isn't adequate, you can specify an alternate fileusing the --cacert option.If this HTTPS server uses a certificate signed by a CA represented inthe bundle, the certificate verification probably failed due to aproblem with the certificate (it might be expired, or the name mightnot match the domain name in the URL).If you'd like to turn off curl's verification of the certificate, usethe -k (or --insecure) option.
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