Use the customer’s certificate
Browsers trust a site only when its certificate names the address they open. Our shipped
certificate names *.friendly-tech.com, so on a customer’s address browsers show a warning. This
page shows how to use the customer’s own certificate instead. The certificate and its key stay on
the customer’s servers. Nothing is uploaded to Deployment Manager (DM).
For the whole install, see Install the system at a customer site.
Before you start
This section lists what you need.
-
An installation in DM. See Step 2. Create an installation.
-
A login on each server that can use
sudo. -
opensslon each server. Check it withopenssl version. The check never runs without it. -
Someone at the customer who can get a certificate from the customer’s certificate authority.
Step 1. Choose the certificate
Each installation answers one question: which certificate do these servers use? The answer lives in
the Certificate block of the installation’s Plan step. It has two choices: The customer’s
(put fullchain.crt and server.key in .ft-tls on each server before installing) and
The built-in one (the screen says "Self-signed. Browsers show a warning." In fact it is a *.friendly-tech.com certificate signed by Friendly Tech’s own root CA. Browsers do not trust that CA, so they show a warning). Only the choice is saved in Deployment
Manager. The certificate files stay on the servers.
To change the certificate choice of an installation that already exists:
-
On the Installations tab, click Change settings on the installation’s card.
-
On the Settings step, click Change in Plan.
-
In the Certificate block of Plan, choose the certificate. The choice is saved at once.
| Answer | Choose it when |
|---|---|
The customer’s certificate |
The customer gives a certificate for these servers' names or IP addresses, from their own certificate authority. Before the first deploy, put |
The built-in certificate (as before) |
The customer has no certificate yet, for example the servers have only IP addresses. Or a proxy in front of these servers holds the certificate. The servers use the built-in certificate (signed by Friendly Tech’s own root CA, not trusted by browsers) that comes in the bundle, and browsers show a warning. You put no files on the servers. On an imported installation, the certificate the site already has in |
An imported installation (DM reads the servers) answers the same question on its first step. See Bring in an existing installation.
Next step: choose the answer, finish the wizard, and make the bundle. See Step 4. Create the bundle.
Step 2. Make the key and the request on each server
Do this on each server that runs a portal, Keycloak, Grafana, the Provision Portal, the configs
UI, Superset’s web server, or an API behind HTTPS. The bundle for such a server has the file
tls.sh. A server whose bundle has no tls.sh needs no files.
tls.sh reads the names this server needs from tls-names.txt, in the same directory as
tls.sh. So always run the copy of tls.sh that sits beside that server’s tls-names.txt.
Before the first deploy, the install directory does not hold tls.sh yet. Run the bundle’s
copy, and tell it where the install directory is:
-
Copy the bundle for this server to the server, and unpack it.
-
Go to the directory that holds
tls.shandtls-names.txt. -
Run this command.
/usr/local/ft-systemis the default install directory. Use yours if it is another.sudo bash tls.sh request --install-dir /usr/local/ft-system
After the first deploy, tls.sh is in the install directory. Run it there:
cd /usr/local/ft-system
sudo bash tls.sh request
tls.sh request does this:
-
It makes the directory
.ft-tlsin the install directory, closed to other users (mode 700). -
It makes the key
.ft-tls/server.key, if there is none. It never replaces a key that is there. -
It writes the request
.ft-tls/request.csr. The request asks for every name intls-names.txt. -
It prints the names, and the next step.
The key stays on this server. Do not send it to anyone.
Next step: send .ft-tls/request.csr to the customer’s certificate authority.
Step 3. Put the certificate in place
The certificate authority sends back a certificate. Save it on the server as
.ft-tls/fullchain.crt in the install directory.
These are the two files, on each server:
| File | What it holds |
|---|---|
|
The server’s certificate first, then the certificates of the chain. In PEM form: text that starts with |
|
The key. |
The customer can also give a key and a certificate they made another way. Put them at the same two paths. The key must have no passphrase.
Then check the files. Before the first deploy, from the bundle directory:
sudo bash tls.sh check --install-dir /usr/local/ft-system
After the first deploy, in the install directory:
sudo bash tls.sh check
tls.sh check never changes your key or your certificate, and it starts nothing. It can do some
cleaning in .ft-tls:
-
It removes temporary files that an earlier run left behind.
-
It finishes a change of
.ft-tls/.in-use/that an earlier run did not end. -
It updates the mark
.ft-tls/temporarywhen the customer’s files replaced the temporary certificate.
To check with no write at all, add --read-only: sudo bash tls.sh check --read-only.
The check looks at the files and their modes, that the first certificate matches the key, the names and the dates. It does not check the rest of the chain. It does not show what the running services use now.
If the files are not valid, the check says why. It also says what a deploy would do: keep the certificate that runs now, or use DM’s temporary certificate. See When the new certificate is not valid.
If you change the files while the check runs, it stops with changed. Then run the check again.
Next step: when the check passes, deploy. See Step 6. Deploy.
Step 4. Deploy
On every run, deploy.sh runs tls.sh check on each server before it changes anything there.
If the check passes, the run goes on. The services read the two files from .ft-tls. Two
services, the portals and Keycloak, run as another user. For them tls.sh makes a copy of the key
that only that user can read, in .ft-tls/portals and .ft-tls/keycloak.
The check can find two kinds of problems:
-
A certificate that is not valid. For example, it has expired, or one of the two files is missing. The run never uses such a certificate, and the run does not stop. See When the new certificate is not valid.
-
A problem with the folder or the bundle. For example, a file is a link, or the key is open to other users. The run stops before anything changes on that server. See What each stop means.
When the new certificate is not valid
The run does this on that server:
-
It does not use the new files.
-
By default, it keeps the certificate that runs now. If no certificate runs there now, it uses DM’s temporary certificate for 30 days. You can choose the temporary certificate in advance. See Choose in advance: keep, or the temporary certificate.
-
It sets the customer’s files aside in
.ft-tls/rejected/<time>/. See Where the customer’s files go. -
It goes on with the install.
The certificate that runs now is the last pair that a deploy or tls.sh apply put to work on
that server. tls.sh keeps a copy of it in .ft-tls/.in-use/. A kept certificate stays even
when it has expired.
After the run, the deploy panel shows one notice for each such server. The notice says what is wrong with the new files, where they were set aside, and the next step. An example:
acs-1 keeps the certificate that runs now, valid until 03 Dec 2026. The new certificate files are not valid: it has expired. They were set aside in .ft-tls/rejected/20261106T143000Z/ on acs-1, and nothing there is overwritten. Next step: get a new certificate from the certificate authority, then run sudo bash tls.sh apply on acs-1.
On the server, tls.sh prints a Warning (kept) line, or a Warning (temporary choice) line,
and a Warning (rejected) line with the next step.
These are the codes for a certificate that is not valid:
| Code | What it means |
|---|---|
|
The certificate does not name an address people use for this server, or has no alternative names at all. |
|
The certificate has expired. |
|
The file |
|
The key has a passphrase, or it is not a key. The services cannot start with it. |
|
The key |
|
The certificate |
A server deployed before this change has no copy in .ft-tls/.in-use/ yet. On its first run with
files that are not valid, tls.sh cannot tell which certificate runs. So it uses DM’s temporary
certificate, and says so. With device TLS on, the device keystore can prove the pair on disk. Then
tls.sh keeps that pair.
Where the customer’s files go
Each time the run does not use the customer’s files, it makes a new folder
.ft-tls/rejected/<time>/ in the install directory. The time is in UTC, for example
20261106T143000Z. The run never writes into a folder that exists. So a request key is never
overwritten, also while you wait for the certificate authority.
The folder can hold these files:
| File | What it is |
|---|---|
|
The customer’s key, or the key that |
|
The customer’s certificate, if it was there. |
|
The request, if it was there. |
|
The certificate and key that ran before. Only when the run replaced them with DM’s temporary certificate. |
|
What was chosen, who chose it, how, the codes and the time. See Every choice is recorded. |
If the files on disk are the certificate that runs now, the run keeps them where they are. Then it sets nothing aside.
The folder stays inside .ft-tls, so only root can read it. It stays until a person removes it.
To finish, do this on that server, in the install directory. Use the folder name from the notice.
The key waits for its certificate (no_certificate):
The run does not leave your request key at .ft-tls/server.key. That path now holds the key of
the certificate that runs, or the temporary key. Your request key is only in
.ft-tls/rejected/<time>/server.key. So put it back before you save the certificate.
-
Put the key back:
sudo cp -p .ft-tls/rejected/<time>/server.key .ft-tls/server.key -
Save the certificate from the certificate authority as
.ft-tls/fullchain.crt. The server’s certificate comes first. -
Run this command:
sudo bash tls.sh apply
The certificate has no key (no_key):
-
Put the key that belongs to the certificate at
.ft-tls/server.key. Only root may read it:sudo chmod 600 .ft-tls/server.key. -
Put the certificate back:
sudo cp -p .ft-tls/rejected/<time>/fullchain.crt .ft-tls/fullchain.crt -
Run
sudo bash tls.sh apply.
Any other code:
-
Fix the files as the
Warninglines say. For example, get a certificate with the missing name. -
Put the fixed files at
.ft-tls/fullchain.crtand.ft-tls/server.key. -
Run
sudo bash tls.sh apply.
tls.sh apply checks the files first. If they are still not valid, it changes nothing and says
why.
Next step: open each site in a browser and look at its certificate.
Choose in advance: keep, or the temporary certificate
With no answer, the run keeps the certificate that runs now. When none runs, it uses DM’s temporary certificate. You can give another answer before the run.
| Where | How |
|---|---|
The deploy panel |
In the dialog Deploy (installation name) - where it goes, each server has this box: If the new certificate on <server> is not valid, use DM’s temporary certificate instead of keeping the one that runs. Tick it to use the temporary certificate on that server. Leave it clear to keep. A retry of that server takes the same answer. The box shows only for an installation with the customer’s certificate. |
A terminal |
|
By hand, on one server |
Add |
By hand, from the first server to the others |
Add |
The bundle |
The file |
|
|
When more than one answer is given, the run takes the first of: the flag, the bundle file, the terminal, the default.
Sometimes nothing new is on the server, and the certificate that runs is itself not valid, for
example expired. Then keep changes nothing. The box or --tls-if-invalid temporary changes the
server to DM’s temporary certificate.
|
DM’s temporary certificate lasts 30 days. It replaces the certificate for every browser, and browsers do not trust it. With device TLS on, devices that do not trust it stop connecting, and the ACS cannot then reach them to fix that. |
The panel shows this warning under each box. The terminal shows it in the answer. tls.sh prints
it before it makes the temporary certificate.
Every choice is recorded
For each server with files that are not valid, the run records the answer:
-
what was chosen: keep or temporary;
-
how: flag, bundle, terminal, default, DM, rollback or by hand;
-
who: the login and the server name, or the DM user who ticked the box;
-
the codes, and the time.
The record is in choice.txt in the rejected/<time>/ folder, when the run set files aside.
tls.sh also prints the line TLS_CHOICE, and DM writes it in its journal. See
Operations journal.
What each stop means
These problems stop the run before anything changes on that server. The panel shows FAIL
tls_files and the sentence from tls.sh. Each sentence names the file and ends with the next
step. A stop has no way past: fix the cause first.
| Stop | What it means |
|---|---|
|
The |
|
A directory, a link or another kind of file is where a file must be. |
|
Other users can read the key or open |
|
|
|
|
|
Another |
|
The files changed while |
|
A rollback, or |
These codes are kept, not a stop: name, expired, pair, passphrase, no_certificate and
no_key. See When the new certificate is not valid.
These lines are warnings. They do not stop the run:
-
Warning (expiring): the certificate expires within 30 days. Get a new one soon. -
Warning (self_signed): the certificate is signed by itself. This is fine for a customer’s private root. A test certificate makes browsers warn.
deploy.sh and tls.sh ignore the option --accept-tls-problem. If a command gives it, they
print one line that says so, and the run goes on as without it.
Next step: do what the stop sentence says, then run the deploy again.
When the customer’s files are not there yet
Sometimes the customer’s certificate is late. If both files, fullchain.crt and server.key,
are missing from .ft-tls, the deploy does not stop. tls.sh makes a temporary key and
certificate on that server. They are valid for 30 days and carry every name in tls-names.txt.
The 30 days is fixed. No setting changes it.
They never leave the server, and DM does not store them. The file .ft-tls/temporary marks them.
Every run on the temporary certificate prints a warning, and prints it again at the end:
Temporary certificate, valid until 03 Dec 2026, 30 days left.
Browsers do not trust it. Only the customer’s certificate fixes that. The deploy panel shows the same warning in the run summary. The pre-upgrade review and the diagnostics file say it too. DM writes down who ran each run on it, which server, and its end date.
When both files are missing, tls.sh makes the temporary certificate only once on that server.
After 30 days the temporary certificate is expired. It is the certificate that runs, so the run
keeps it by default. To get a new temporary certificate for 30 days, choose the temporary
certificate in advance. See Choose in advance: keep, or the temporary certificate.
If only one of the two files is there, the certificate is not valid (no_certificate or
no_key). See When the new certificate is not valid.
Next step: put the customer’s fullchain.crt and server.key in .ft-tls, then run
sudo bash tls.sh apply. From then on tls.sh checks the customer’s certificate as usual.
A rollback checks the certificate too
A rollback checks the installation it puts back. If that installation had tls.sh beside its
files, the rollback runs the check first, before it changes any file or container.
-
If the files are valid, the rollback goes on.
-
If the files are not valid, the rollback keeps the certificate that runs now. It never makes a temporary certificate, and it asks nothing.
-
If the files are not valid and no certificate is recorded as running, the rollback stops with
no_current. Nothing is changed. -
A folder problem stops the rollback, as for a deploy.
If the installation it puts back had no tls.sh, it used the built-in certificate, and the
rollback checks nothing. If the deploy.sh on the server comes from a bundle with the built-in
certificate, it cannot keep a certificate. Then files that are not valid stop the rollback, and
nothing is changed.
Next step: if a rollback stops, put a valid certificate in .ft-tls on that server, then run the
rollback again.
Replace a certificate
A certificate ends, or the customer adds a name. You need no new bundle for this.
-
If the names changed, make a new request in the install directory.
tls.sh requestkeeps the key that is there:cd /usr/local/ft-system sudo bash tls.sh request -
Save the new certificate as
.ft-tls/fullchain.crt. The server’s certificate comes first. -
Run this command in the install directory:
sudo bash tls.sh apply
tls.sh apply checks the files, writes the key copies again, then recreates only the services
that use the certificate. They must be recreated, not reloaded: a running container keeps reading
the old file. The APIs behind HTTPS do not restart.
Next step: open each site in a browser and look at its certificate.
Move a running installation
To the customer’s certificate:
-
Put the two files on each server, as in Step 2 and Step 3.
-
In DM, click Change settings on the installation’s card, then Change in Plan. In the Certificate block, choose The customer’s.
-
Make a new bundle, and run it.
The run checks the files first. If they are not valid, the run does not use them. No customer certificate runs there yet, so the server uses DM’s temporary certificate. See When the new certificate is not valid. A folder problem stops the run before it changes anything.
Back to the built-in certificate:
-
In DM, click Change settings on the installation’s card, then Change in Plan. In the Certificate block, choose The built-in one.
-
Make a new bundle, and run it.
-
The run removes
tls-proxyby itself, and says so. You do not need to press anything.tls-proxyhas no data. The services show their own HTTPS ports again.
The files in .ft-tls stay on the server, and nothing reads them. You can leave them there.
When an imported installation moves to the customer’s certificate, the upgrade asks no questions about the certificate files that change.
Next step: after the run, open each site in a browser and look at its certificate.
Device TLS
Devices are a separate switch: Devices use this certificate too, under the customer’s certificate. It is off by default. Off, devices connect as they do today.
On, the ACS shows the customer’s certificate to devices on ports 8443, 4430, 61618, 18882 and 8883.
|
Devices check this certificate against what they already trust. A device that does not trust its issuer stops connecting, and the ACS cannot then reach it to fix that. Check one device of each model first. |
Before you turn it on:
-
The certificate must name the address your devices use to reach the ACS. That is often a public name, a NAT address, or the address of a load balancer. With the switch on, DM asks for it in Address devices use to reach the ACS: type each name or IP address your devices have in their ACS URL, with commas between them. DM writes them into
tls-names.txtof the ACS server, sotls.sh checktests that the certificate names each one. To see the names in the certificate:sudo openssl x509 -in /usr/local/ft-system/.ft-tls/fullchain.crt -noout -ext subjectAltName -
Docker Compose on the ACS server must be 2.24 or newer. Check it with
docker compose version --short. An older one stops the run.
While it is on, deploy.sh prints the warning on every run. If a run uses DM’s temporary
certificate, the ACS shows that certificate to devices too. Devices that do not trust it stop
connecting. See Choose in advance: keep, or the temporary certificate. tls.sh builds the device keystore
.ft-tls/server.p12 and its password file .ft-tls/keystore.env from the two files. DM never
asks for these passwords.
When you tick the box, DM shows this warning and asks you to confirm. To turn it off, clear the box and save. If you choose The built-in certificate (as before) while it is on, DM asks you to confirm first, because a device set to trust only the customer’s certificate stops connecting.
Next step: after the run, check that one device of each model still connects.
Validate under the customer’s certificate
Validate checks the certificate before it sends any account. For each port on this server that
uses the certificate, it compares the certificate the port serves with .ft-tls/fullchain.crt.
They must be the same. It then reads the names and the dates from that file.
-
The results are rows in a group
TLS, for example Certificate - portals. -
An account is never sent to a port that failed. The tests that need it are not checked, with the reason
TLS failed. -
A port on another server says "on another server, run validate there". Run Validate on that server too.
-
QT_NBI_INSECURE=1is refused. -
Only root can read
.ft-tls. If Validate says so, run it again as root:sudo ./validate.sh.
Next step: if a row failed, do what its sentence says, then validate again.
UI Backend and a private certificate authority
UI Backend signs in to Superset over HTTPS, so it must trust the portal’s certificate.
-
When the portal runs on the same server, UI Backend trusts
.ft-tls/fullchain.crt. You do nothing. -
When the portal runs on another server, UI Backend trusts only the authorities its Java knows. A certificate from a public authority works. A certificate from the customer’s private authority does not: the dashboards in the portal stay empty, and the smoke check says UI Backend does not trust the certificate.
Next step, for a private authority on a server without the portal: save the customer’s root
certificate as ui-backend/config/ssl/friendly.crt in the install directory, then recreate UI
Backend:
cd /usr/local/ft-system
sudo docker compose up -d --force-recreate ui-backend
What never leaves the server
The key, and everything else in .ft-tls, stays on the server. This includes the copies in
.ft-tls/.in-use/ and .ft-tls/rejected/. It is never in:
-
the bundle, or a report the bundle sends back;
-
the safety copy that an upgrade makes, or a rollback;
-
the files the upgrade guards;
-
the diagnostics archive;
-
the inventory of an import;
-
DM.
DM keeps only public facts of the certificate: its names, its end date and its fingerprint. The upgrade review shows the names and the end date for each server. It also warns, without stopping anything:
-
when a server still serves our shipped certificate;
-
that plain HTTP ports, such as 8880, 9880 and 8085, still answer and go around the certificate. Close them on the firewall.
Next step: if the review warns about a server, put the customer’s files there and run the bundle again.