Loading the documentation…

TLS and certificates

Two addresses need certificates. The DataMind OS gateway holds its own: you give it during the first install, or later in Configuration. Your reverse proxy holds the one for the DataMind Installer.

DataMind OS: HTTPS or HTTP at setup

The first step of Configure Platform asks How will people reach DataMind OS? and offers two cards. Clicking a card opens its next page; the step has no Next button.

CardWhat it saysWhat comes next
HTTPS, marked RecommendedEncrypted. Needs a domain name and its certificate.The domain and its certificate, then the checks
HTTPNot encrypted. People open DataMind OS at the server's address, usually its IP.The server address

Without a domain or a certificate yet, choose HTTP. If you already chose HTTPS, Back returns to the two cards; nothing from the HTTPS pages is saved until you click Finish there.

The whole first install, with the License Key on the same step, is on Install in depth. Until you start the installation, Change how DataMind OS is reached, under the saved address, takes you back to this choice.

HTTPS: the domain and its certificate

  1. Enter the Domain, for example datamind.example.com. The line under the field shows the address people will open, https://<domain>, and reminds you that its DNS record must point at this server. A pasted address is cut down to its host name.
  2. Under Certificate, give the certificate and its private key in one of two ways:
    • Upload them, the default: choose the Certificate file, with the chain and the Private key file. Both are PEM files (.pem, .crt, .cer, .key) of up to 64 KB. The certificate file holds the server certificate first, then its intermediate certificates, and the private key must not have a password.
    • Give their paths on the server: click Use file paths on the server instead and enter the Certificate path and the Private key path, full paths that start with /, such as /etc/ssl/datamind/fullchain.pem. DataMind OS reads the files from there, so leave them in place. Upload the files instead switches back.
  3. Click Next. The Installer runs the HTTPS checks. Nothing is saved yet.
  4. When no check failed, click Finish. After a fix, Run again repeats the checks; Back returns to the domain and the certificate.
Warning

When you opened the Installer over plain http:// at an address other than localhost, the upload shows: "This page is not encrypted, so an uploaded private key would cross the network in clear text. To keep it off the network, copy the files to the server (for example with scp) and use file paths on the server instead."

Finish runs the checks once more. If one fails now, it stops with HTTPS was not set up. <check>: <what it found>. Otherwise it saves PLATFORM_URL as https://<domain>, and SSL_CERT_PATH and SSL_KEY_PATH:

You gaveSSL_CERT_PATH and SSL_KEY_PATH name
Uploaded filesdeployment/ssl/certificate.pem and deployment/ssl/private-key.pem in the install directory, where the Installer writes your certificates and your private key. A private key inside the certificate file is not copied
File pathsThe paths you entered

Finishing with file paths, or with HTTP, deletes files uploaded before.

HTTP: the server address

  1. Server address is filled in from the address you opened the Installer with, such as http://10.0.0.5. Change it if people reach this server another way. An address without a scheme gains http://.
  2. Click Finish.

The address must be an http:// address without a path, and without a port other than 80: DataMind OS answers on port 80. Finish saves it as PLATFORM_URL, empties SSL_CERT_PATH and SSL_KEY_PATH, and deletes a certificate and key uploaded before.

The HTTPS checks

The checks run on Next, on Run again and once more on Finish, and save nothing. Each row shows its result, passed, warning, failed or not checked, then what was found and, when there is something to change, a What to do: line. Finish stays off while a check has failed; warnings never block it. The line under the list reads:

CheckFails whenWarns when
Domain name resolvesThe domain has no DNS record or no A or AAAA record, the server's DNS servers do not answer, or it resolves to a loopback address such as 127.0.0.1It resolves on this server only through the server's own settings (its hosts file or a search domain), not through its DNS servers
Domain points at this serverIt leads to a different DataMind Installer. Not checked while the DNS check failsIt also resolves to addresses that are not this server's, or the Installer could not confirm that it leads here
Certificate files are readable on the serverWith file paths only: a file does not exist on this server, is a folder, a pipe or a device, cannot be read, is empty, is larger than 64 KB, or could not be read in timeNever
Certificate and key are PEM filesA file is binary (DER), the certificate file holds a signing request (CSR), the two files are swapped, the key is a public key, has a password or is in OpenSSH format, or the key is Ed25519, Ed448, DSA or RSA-PSS, which browsers cannot useAn RSA key is shorter than 2048 bits, or, with file paths, the certificate file also holds the private key
Certificate covers the domainThe certificate was not issued for the domain, or the first certificate in the file is a certificate authority instead of the server certificateNever
Certificate is within its validity datesIt is not valid yet, or it has expiredIt expires within 30 days
Private key matches the certificateThe key belongs to another certificate, or to one later in the fileNever
Certificate chain reaches a trusted rootAn intermediate certificate is missing, or one in the chain has expiredThe certificate is self-signed, or the chain ends at a private certificate authority: browsers then trust it only on computers where it was installed as trusted

When a check fails, its What to do: line names the fix, with the openssl command for a binary file, a password-protected key or a .pfx or .p12 file. A wildcard certificate such as *.example.com covers datamind.example.com, one level down only.

How the Installer tells that the domain leads here. It calls itself through the domain on its own port, <domain>:8000, and it compares the addresses the domain resolves to with the server's network addresses and with the address you opened the Installer with. When the call does not reach it and none of the addresses is this server's, for example behind NAT, a load balancer or a firewall that blocks port 8000, the check warns that the domain is not confirmed. Then make sure ports 80 and 443 of the domain reach this server.

How it reads files given as paths. It starts a short-lived container named datamind-installer-check-<id> from its own image, with only that file mounted read-only and no network, and removes it when the read ends or after 20 seconds. Paths are case-sensitive and name files on the server, not on your own computer.

DataMind OS: change the certificate later

After the install, change the certificate in Configuration. Configuration does not run the HTTPS checks.

The DataMind OS gateway (Openresty in the Services panel) picks its mode when its container starts:

The gateway findsIt servesIts log line
Non-empty cert.pem and key.pem in /etc/openresty/sslHTTPS[openresty] SSL certs detected - HTTPS enabled
Either file missing or emptyHTTP[openresty] No SSL certs - HTTP only
  1. In Configuration, set SSL_CERT_PATH and SSL_KEY_PATH to the absolute paths of the certificate and key files on the host. The key row is required once the certificate row has a value.
  2. Click Save changes, then Apply changes in the prompt. The gateway is recreated with the new paths.
  3. After you renew the certificate files, restart the gateway so it reads them again: on Service status, hover Openresty in the Services panel and click its restart button.

Check it worked.

bash
docker ps --format '{{.Names}}' | grep -i openresty
docker logs <gateway-container> 2>&1 | grep '\[openresty\]'
text
[openresty] SSL certs detected - HTTPS enabled

Then open the platform address in a browser and check the certificate's issuer and expiry date.

The platform address decides http or https

The setup saves the address from your choice: https://<domain> for HTTPS, the http:// server address for HTTP. You can change it later as PLATFORM_URL in Configuration. There the Installer normalises the value before it saves it, so a bare address is accepted and the saved value always carries a scheme.

You typeThe Installer saves
An address with http:// or https://Kept as typed, without trailing slashes
A domain name without a scheme, such as data.example.comhttps://data.example.com
localhost, a *.localhost or *.local name, or an IP address, without a schemehttp:// plus the address
Any other scheme, such as ftp://Nothing. It answers PLATFORM_URL must be an http:// or https:// address, got "ftp:"
An empty valueNothing. It answers PLATFORM_URL cannot be empty
A value that is not an addressNothing. It answers PLATFORM_URL is not a valid address: "<value>"

To serve DataMind OS over HTTPS on an IP address, type https:// yourself in PLATFORM_URL and set the certificate rows; the setup's HTTPS card needs a domain name.

The saved value is the root of every address the deployment derives, so set it to the address your users type.

The Installer: put it behind your proxy

The Installer serves HTTP on port 8000. Terminate TLS in your reverse proxy or load balancer, then allow only the proxy through, as Restrict the port shows.

Your proxy mustBecause
Send X-Forwarded-Proto: httpsThe Installer marks its session cookies Secure only on HTTPS requests or with this header set to https
Pass the browser's original Host headerThe Installer derives the cookie domain from Host. See Sign-in loops behind a proxy
Rate-limit POST /api/auth/loginProtects the sign-in endpoint against password guessing
Turn response buffering offJob and service logs stream as server-sent events. With buffering they arrive in bursts

Opened through your proxy over https://, the setup's upload no longer shows the warning about an unencrypted page.

Sign-in loops behind a proxy

When the browser's Origin host differs from the Host the Installer sees, or is missing, the Installer sets the cookie domain to the last two labels of Host. This happens when your proxy rewrites Host to its upstream address. While Origin and Host match, no domain is set:

Host the Installer seesCookie domainResult
installer.example.com, passed through unchangedNoneWorks
127.0.0.1, rewritten to the upstream.0.1Rejected by the browser
10.0.0.5, rewritten to the upstream.0.5Rejected by the browser

A rejected cookie means the password is accepted and you land back on the sign-in screen. Pass the original Host through, so Origin and Host match and no domain is set. The session rules behind both cookies are on Sign in, sessions and account.

Check it worked. Sign in through the proxy and open the browser's developer tools. Both session cookies show Secure and HttpOnly, and no domain other than the host you typed.

Questions, answered

Can I use the server's IP address with HTTPS?

Not in the setup. The HTTPS card needs a domain name and refuses an IP address with Enter a domain name, not an IP address. To use the IP address, go back and choose HTTP. Choose HTTP for an IP address. After the install, you can still type an https:// IP address in PLATFORM_URL and set the certificate rows in Configuration.

Why is Finish off after the checks?

A check failed, or was not checked because a check it needs failed. Read its What to do: line, fix the record or the files, and click Run again. Back lets you change the domain or the certificate. Warnings never keep Finish off.

The domain check could not confirm that the domain leads here. Can I still finish?

Yes. It is a warning. The Installer could not reach itself through <domain>:8000, and the domain resolves to none of this server's addresses, which is expected behind NAT, a load balancer or a firewall that blocks that port. Make sure ports 80 and 443 of the domain reach this server. Only a domain that leads to a different DataMind Installer fails.

Is a self-signed certificate accepted?

Yes, with a warning. No certificate authority vouches for it, so browsers trust it only on computers where it was installed as trusted. Fine for an internal deployment: make sure every computer that opens DataMind OS trusts it, or use a certificate from a certificate authority. A chain that ends at your organisation's own root is treated the same way.

Why does DataMind OS serve HTTP after I set a certificate?

The gateway did not find both files. It logs [openresty] No SSL certs - HTTP only. Check SSL_CERT_PATH and SSL_KEY_PATH in Configuration and point them at the real files, then click Apply changes. If only the file contents changed, restart the gateway.

Why do I land back on the sign-in screen behind our proxy?

The browser rejected the session cookie. Your proxy rewrites Host, so the Installer sets a domain such as .0.1. Pass the original Host header through, as Sign-in loops behind a proxy describes.

Do I need to type http:// in front of the address?

No. In the setup's HTTP step, an address without a scheme gains http://. In Configuration, localhost, *.local names and IP addresses are saved with http://, other hostnames with https://, and trailing slashes are stripped. A scheme you type is kept.

Which certificate files do the two rows take?

The certificate and its matching private key, as absolute paths on the host. The rows show example paths from a Let's Encrypt setup (/etc/letsencrypt/live/example.com/fullchain.pem and /etc/letsencrypt/live/example.com/privkey.pem); point them at the files your certificate authority gives you. Files you uploaded during setup sit at deployment/ssl/certificate.pem and deployment/ssl/private-key.pem in the install directory.

What happens if I set only one of the two paths?

Once SSL_CERT_PATH is set, SSL_KEY_PATH is required. The next install, Start, Update or Apply changes stops with Missing required configurations: <codes>, naming the missing row, for example SSL_KEY_PATH. Set both paths to continue.

What do I do after the certificate is renewed?

Restart the gateway. It reads its certificate files when its container starts, so after you replace them, restart it from Service status: hover Openresty in the Services panel and click its restart button. If the renewed files live at new paths, set the new paths in Configuration and click Apply changes instead.

Can the Installer serve HTTPS by itself?

No. It serves HTTP on port 8000, so terminate TLS in your reverse proxy or load balancer. The DataMind OS gateway keeps its own certificate.

Why do the live logs arrive in bursts through our proxy?

Response buffering. Job output and service logs arrive as server-sent events, and a buffering proxy holds them back until a buffer fills. Turn response buffering off for the Installer's address.