Skip to content

TLS and mutual TLS on your links

Every link the Platform offers can use TLS: simulated hosts your switch connects to, scenario runs against your own systems, and the HSM’s command port. Certificates come from the install’s own test CA, kept in the key vault. This walkthrough sets up mutual TLS between a switch and a simulated issuer, then tests that the switch refuses what it should.

Open Certificates (under Settings). The Test CA card shows the CA every certificate here is issued by. Download the CA certificate and add it to your switch’s trust store. Its private key never leaves the vault.

  • For the simulated issuer: issue a certificate used by Server, with the names your switch will connect by (host names or IP addresses).
  • For your switch: either issue one used by Client and Download key (once, as PKCS#12 with a password, or PEM), or paste your switch’s certificate signing request into Sign a request. With a request, the switch keeps its private key.

Every issue, download and use is in the audit trail at the bottom of the page.

In the host form, tick Serve TLS instead of plain TCP, choose the server certificate, and set Client certificates to Require one (mutual TLS). The host page then says the host serves mutual TLS and links the CA.

Point the switch at the host. Live activity marks each exchange mTLS; hover it for the version, cipher and the client certificate’s name. The message log keeps the same.

A scenario that targets the simulated host uses TLS automatically. If the host requires a client certificate, give the scenario one:

target:
simulated_host: Secure issuer
tls: {client_certificate: "<the client certificate's id>"}

Runs reach simulated hosts at an internal address no certificate names, so the host’s name is checked only when the scenario gives one: tls: {server_name: issuer.test}, the name your switch connects by.

For your own system, name the host and the TLS settings:

target:
host: switch.bank.test
port: 8583
tls:
client_certificate: "<id>" # when your system asks for one
server_name: switch.bank.test # when it differs from host

The id is on the certificate’s row in Certificates.

A scenario step that expects connection_refused: true passes only if the system refuses the connection before answering. One scenario per case, with your system as the server:

  • An expired certificate: issue one with Issue it already expired and present it: tls: {client_certificate: "<expired id>"}.
  • A wrong name: check the switch’s certificate against another name: tls: {server_name: wrong.example}.
  • An unknown CA: import a certificate from another CA (admins, in Certificates) and present it.
  • No client certificate: leave client_certificate out against a switch that requires one.

examples/scenarios/tls-negative.yaml shows the pattern.

6. Check that your switch refuses a bad host

Section titled “6. Check that your switch refuses a bad host”

When your system is the client (a switch connecting to an issuer), test that it refuses a host it shouldn’t trust. In the host form, keep the host’s own certificate and set Presents to a negative test:

  • An expired copy: the host’s certificate, expired yesterday.
  • A copy from a CA nobody trusts: the same names, signed by the vault’s untrusted CA rather than the install’s.
  • A copy for the wrong name: a valid certificate from the install’s CA, for wrong-name.invalid only.

The vault makes the copy each time the host starts, with a new key, and records it in the audit trail; it isn’t kept as a certificate. Copies of a certificate imported from another CA can only be from a CA nobody trusts, since an expired or misnamed copy from the install’s CA would also have the wrong issuer. The host page says the host presents a bad certificate on purpose.

Your switch should refuse each one. When it does so with a TLS alert, as most do, the host’s activity records the reason: The client refused the host’s certificate as expired, it doesn’t trust the CA, or bad certificate, such as a wrong name. A switch that just hangs up leaves no reason to record, so check its own log too. At most five refusals a second are recorded, so a switch reconnecting in a loop can’t flood the activity; every refusal counts as an error.

examples/scenarios/tls-host-certificates.yaml checks the same thing with the Platform as the client, so you can see a refusal before pointing your switch at it. For an old TLS version, set Versions to TLS 1.2 only, against a system that requires TLS 1.3.

When a host asks for client certificates, it also checks them against the install CA’s revocation list, unless Refuse client certificates revoked in Certificates is unticked.

In Certificates, Revoke a certificate the install’s CA issued (whoever issued it, or an admin can) and give a reason. Revoking is permanent: to use the system again, issue it a new certificate. Hosts refuse the revoked certificate from their next handshake, without restarting; connections already open stay open. Their activity says Refused the client’s certificate: certificate revoked.

The vault issues a new revocation list with every revocation, and daily, valid for seven days. Download the revocation list on the Test CA card to load it into your own systems. Certificates imported from another CA can’t be revoked here: revoke them where they were issued.

examples/scenarios/tls-revoked-client.yaml shows a host refusing a revoked certificate.

The HSM speaks plain TCP on port 1500 unless HSM_TLS_CERTIFICATE in the install’s .env names a server certificate’s id. Then it serves TLS, and with HSM_TLS_CLIENT_AUTH=required, mutual TLS. See the operations guide.