For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

How to Configure SSL/TLS/HTTPS Security

Set up SSL/TLS to secure GridGain node-to-node, thin-client (ODBC/JDBC), and HTTPS REST traffic with a self-signed certificate authority.

Prerequisites

  • A GridGain 8 cluster

  • OpenSSL 1.1.1

  • JDK 17 (OpenJDK)

  • The Java keytool utility

Overview

GridGain's distributed processing allows fast calculations and data queries by sending data between nodes, thin clients, and other applications connected to the system. However, transmitting data is done in plain text and may not be safe for your organization's most sensitive data. Hence, it is essential to have a data security strategy in place.

This guide explains how to use SSL/TLS protocols to provide a secure connection among all nodes, thin clients, and HTTPs clients.

Configuration and Preparation

This example uses the following applications:

Item
Version

GridGain

8.10.X

Security Protocol Version

TLSv1.2

OpenSSL

1.1.1

JDK

openjdk version 17

The following algorithms may be supported https://docs.oracle.com/en/java/javase/17/docs/specs/security/standard-names.html#sslcontext-algorithms. However, you should check the JAVA release documentation for your implementation to see if these algorithms are supported. By default, JAVA 17 enables the following protocols:

  • TLSv1.2

  • TLSv1.3

TLSv1 and TLSv1.1 are disabled by the default JDK security policy. For this example, the connections use TLSv1.2.

To obtain an SSL certificate from a certificate authority (CA), you need to generate a certificate signing request (CSR). A CSR consists mainly of the public key of a key pair and some additional information. Both of these components are inserted into the certificate when it is signed.

Create a certificate authority to sign certificates for GridGain nodes keys by using the following steps:

  1. Generate a CSR and a private key:

    The following options are used here:

    • -newkey rsa:2048 - key should be 2048-bit, used algorithm is RSA

    • -nodes - private key should not be encrypted with a passphrase

    • -new - CSR is being generated

    The command will prompt the following questions:

    Question
    Response

    Country Name (2 letter code)

    The two-letter country code where your company is legally located.

    State or Province Name (full name)

    The state/province where your company is legally located.

    Locality Name (e.g., city)

    The city where your company is legally located.

    Organization Name (e.g., company)

    Your company's legally registered name (e.g., YourCompany, Inc.).

    Organizational Unit Name (e.g., section)

    The name of your department within the organization. (You can leave this option blank; simply press Enter.)

    Common Name (e.g., server FQDN)

    The fully-qualified domain name (FQDN) (e.g., www.example.com).

    Email Address

    Your email address. (You can leave this option blank; simply press Enter.)

    A challenge password

    Leave this option blank (simply press Enter).

    An optional company name

    Leave this option blank (simply press Enter).

    After this command the ca.csr and ca.key files will be generated.

  2. Generate the SSL certificate:

    The following options are used here:

    • -req - the input is a CSR

    • -signkey - the key that signs the certificate, which makes it self-signed

    • -trustout - marks the output as a trusted certificate

    • -in - which CSR will be used

    • -out - path to the generated certificate

    After this command the ca.pem file will be generated. This is the self-sign certificate of the new CA. You can now use it to sign certificates. Note that other applications will not accept such certificates on HTTPS since anybody could have signed it; but it's secure for nodes if you don't lose ca.key.

  3. Put the generated certificate into a Java key store:

    The following options are used here:

    • -import - new certificate should be added to keystore

    • -file - which certificate should be added to keystore

    • -keystore - which keystore will be used

    • -alias - some unique name which will be associated with current certificate

    After setting the password, the trust.jks file will be generated. Note that every node may have their own primary key, which should be also signed by our CA.

  4. Prepare the configuration file (ca.cnf):

    Here index.txt and serial files should be generated:

    Now you are ready to configure SSL in the GridGain cluster. Make sure that you have all the following files:

  5. Use the following script to generate the certificates for your GridGain cluster:

    The script generates the following certificates:

    • node.jks - can be used by any cluster node

    • client.jks - can also be used by any cluster node, but you will use it for thin connections

    • client.pem and ca_odbc.pem - can be used for ODBC connection

SSL/TLS for Thick Nodes

Before configuring GridGain nodes, you must generate the private key for every node. Here is an example of how this can be done for one node:

  1. Generate the primary key for a node:

    This will create the node.jks file.

  2. Generate the CSR for node:

    This will create the node.csr file.

  3. Using the previously created ca.cnf, create a signed certificate for the node:

    This will create the node.pem certificate.

  4. Add both node.pem and ca.pem certificates to the Java key store:

    After these commands node.jks file should be created. Both node.jks and trust.jks files can now be used to configure the SSL/TLS for GridGain node. Here is the XML configuration file:

  5. Now start the nodes and make sure to add -Djdk.tls.client.protocols=TLSv1.2 JVM option to tell JVM that you are going to use TLS > 1.2.

Now you can take a look at the logs:

You can see now that TLS/SSL is working. Note that TLS/SSL does not provide any authorization; it only provides secure messaging between nodes (authentication).

Check what happens if you add a client without correct certificates:

  • Client node without SslContextFactory

  • Client node with incorrect certificate

When everything is configured correctly, you will see that both nodes have discovered each other:

This method can be used by cluster thick nodes and clients (that can use IgniteConfiguration):

  • GridGain servers (Java, .Net, C++)

  • GridGain clients (Java, .Net, C++)

  • GridGain Jdbc Driver

Following sections describe how to configure SSL/TLS for thin clients (ODBC/JDBC) and HTTP connections (REST).

SSL/TLS for Thin Clients (ODBC/JDBC)

To use SSL/TLS for communication between your GridGain cluster and thin clients, you will need to configure the ClientConnectorConfiguration bean in your nodes' XML configuration, like so:

Thin JDBC Client

GridGain thin JDBC driver allows you to use secure socket communication to provide a secure connection between JDBC driver and GridGain node (includes the initial handshake).

Here is an example of how to create a secure thin JDBC connection:

The following properties are used here:

  • sslMode - enables SSL connection

    Available modes - require: SSL protocol is enabled on the client. Only SSL connection is available. disable: SSL protocol is disabled on the client. Only plain connection is supported.

  • sslClientCertificateKeyStoreUrl - URL of the client key store file

  • sslClientCertificateKeyStorePassword - client key store password

  • sslTrustCertificateKeyStoreUrl - URL of the trust store file

  • sslTrustCertificateKeyStorePassword - trust store password

You can find other JDBC parameters in the documentation here: https://www.gridgain.com/docs/gridgain8/latest/developers-guide/SQL/JDBC/jdbc-driver

Thin ODBC Client

Since an ODBC connection can't be started with Java, JKS can't be used. In case if you have generated two JKS for server node and client node, then you can prepare the required keys and certificates using the following OpenSSL commands from created files:

  • node.jks will be used by server node that will be used for ODBC connection

  • client.jks will be used by ODBC clients..

Now you are ready to make the ODBC connection using following connection string:

You can read more about the ODBC connection string and its parameters here: https://www.gridgain.com/docs/gridgain8/latest/developers-guide/SQL/ODBC/connection-string-dsn

HTTPS for REST

REST can also use a secured connection to cluster. In this case, you will need to set up -Dhttps.protocols=TLSv1.2 and configure the Jetty https server, as well as perform following additional steps:

  1. Prepare the configuration file for generating of the certificates:

    It's important to have the same CN (or alt_names) as used in the server. Otherwise, the SSL handshake can fail.

  2. Generate the private key and certificate for REST:

  3. Prepare the Jetty configuration file for HTTPS support:

  4. Add the following dependency to your pom.xml file:

  5. Add the path for Jetty configuration into connectorConfiguration:

    sslClientAuth on ConnectorConfiguration does not make the Jetty server require a client certificate. To require one for REST requests, add <Set name="needClientAuth">true</Set> to the sslContextFactory bean in jetty.xml. Without a client certificate, the TLS handshake then fails.

  6. After configuring the HTTPS Jetty web server, you can run the following REST command in your browser:

    If you see an output similar to the one below, then HTTPS was configured correctly.

This page is: Copyright © 2026 MariaDB. All rights reserved.

Last updated

Was this helpful?