Skip to main content
For this step, you must log in with an identity that has a role with the following permissions: Keys:All Slots, Management Commands:Certificates, Management Commands:Keys, Security:TLS Sign, and TLS Settings:Upload Key. You can use the default Administrator role and Admin identities.
To configure TLS authentication, choose one of the following methods:
  1. Enable server-side authentication (anonymous TLS). The connection is encrypted and the HSM doesn’t require a client certificate.
  2. Create connection certificates for mutual authentication. The HSM and the client each present a certificate.
Futurex recommends option 2, mutual authentication, for production. Server-side authentication is simpler to set up for testing.

Enable server-side authentication

Choose one of the following methods to enable server-side authentication:

Excrypt Manager

Go to the SSL/TLS Setup menu, select the Excrypt Port in the Connection Pair drop-down list, check the Allow Anonymous box, and select [ Save ]. Then select [ Restart Connection Pair ] so that the change takes effect.

FXCLI

Run the following tls-ports FXCLI commands to allow anonymous TLS on the Excrypt port and restart the TLS service so that the change takes effect:
FXCLI

Configure the client

In the <HSM> section of the fxcng.cfg file, set the following fields:
fxcng.cfg

Create connection certificates for mutual authentication

The following example shows how to use FXCLI to create a CA, use it to sign the HSM server certificate, and push the server certificate to the Excrypt port. Then you create a client certificate for the computer that runs Futurex CNG, by using one of the following options:
  • Windows certificate store (recommended): certreq creates the client key in the local computer’s certificate store, and Futurex CNG finds the certificate by its name. You don’t need OpenSSL or a file password.
  • PKCS #12 file: OpenSSL creates the client key, and Futurex CNG reads it from a password-protected PKCS #12 file.
  • Run FXCLI on a computer connected to the HSM, either through the front USB port or over the network on the admin port (9009).
  • If you don’t specify a file path for commands that create an output file, FXCLI saves the file to the current working directory.
  • Using user-generated certificates requires you to load a PMK on the HSM.
  • HSM key slot labels, such as TlsCaKeyPair, can contain only letters, digits, and underscores.
  • Run help to list all commands, or a command name followed by help to list its options.
1
Open the FXCLI prompt by running fxcli-hsm in a terminal.
2
Connect to the HSM. To connect through the front USB port, run the following command:
FXCLI
3
Log in with both default Admin identities. Run the following command twice, once for each identity, and enter the username and password when prompted:
FXCLI
4
Generate a TLS CA key pair and store it in an available key slot on the HSM:
FXCLI
5
Create a root certificate. Replace the example distinguished name with your organization’s values:
FXCLI
6
Generate the server key and CSR for the Excrypt port:
FXCLI
Each tls-ports request command replaces the server key. Complete the following steps with this CSR before you run tls-ports request again; a certificate signed from an earlier CSR doesn’t match the new key.
7
Sign the server CSR with the TLS CA. Add a --san option for each hostname or IP address that clients use in the <ADDRESS> field, such as --san dns:hsm.example.com. The library checks the hostname only if you set <TLS-CHECK-SANS> to YES in the <CONFIG> section of fxcng.cfg; without a matching SAN, that check fails:
FXCLI
8
Push the signed server certificate and the CA to the Excrypt port, and require client certificates:
FXCLI
9
Restart the TLS service so that the HSM starts using the new certificate:
FXCLI
Existing connections to the Excrypt port drop while the TLS service restarts. The new certificate can take up to a minute to take effect.

Option 1: Client certificate in the Windows certificate store

Perform these steps on the computer where you installed Futurex CNG, in an elevated PowerShell session, unless the step says FXCLI.
1
Create a certreq policy file named certreq_policy.inf with the following content. The Subject common name is the name that Futurex CNG uses to find the certificate:
certreq_policy.inf
The policy doesn’t set ProviderName, so Windows creates the TLS client key in a Microsoft software provider, not in the HSM. Futurex CNG needs this key to connect to the HSM, so it can’t be stored there.
2
Create the key pair and the CSR:
PowerShell
The output ends with CertReq: Request Created.
3
Copy client.csr to the FXCLI workstation. At the FXCLI prompt, sign it with the TLS CA:
FXCLI
4
Copy signed_client_cert.pem and TlsCa.pem back to the Futurex CNG computer, into C:\Futurex\tls. Install the signed certificate so that Windows associates it with the key that certreq created:
PowerShell
certreq -accept prints the installed certificate with Subject: CN=Futurex CNG Client. To confirm that the private key is present, run Get-ChildItem Cert:\LocalMachine\My | Where-Object Subject -eq 'CN=Futurex CNG Client' | Select-Object Subject, HasPrivateKey; HasPrivateKey must be True.
In the <HSM> section of the fxcng.cfg file, set the following fields:
fxcng.cfg
<PROD-TLS-KEY> is the certificate’s common name. Keep the <PROD-TLS-CA> line: Futurex CNG verifies the HSM certificate only against the CA files listed in fxcng.cfg, not against the Windows Trusted Root Certification Authorities store, so without it the TLS handshake fails with certificate verify failed.

Option 2: Client certificate in a PKCS #12 file

1
In a terminal (not the FXCLI prompt), use OpenSSL to generate the client key and CSR:
Shell
2
At the FXCLI prompt, sign the client CSR with the TLS CA:
FXCLI
3
In a terminal, create a PKCS #12 file that contains the client key, the client certificate, and the CA. OpenSSL prompts for an export password:
Shell
4
Copy PKI.p12 to the Futurex CNG computer, for example to C:\Futurex\tls\PKI.p12. Restrict the file permissions so that only administrators and the account that runs the application can read it. After you create PKI.p12, delete privatekey.pem from the workstation.
5
Set the PKCS #12 password in a system environment variable, so that every process that loads Futurex CNG, including Windows services, can read it. In an elevated PowerShell session, run the following command, replacing [p12_password] with the export password:
PowerShell
Futurex CNG runs inside the application’s process, so the variable must be in that process’s environment. Restart the application or service after you set it. A variable that you set only in the current PowerShell session ($env:FXCNG_P12_PASS = ...) isn’t visible to other processes.
In the <HSM> section of the fxcng.cfg file, set the following fields:
fxcng.cfg
For other ways to supply the password, see Edit the Futurex CNG configuration file. Because the Excrypt port now requires client certificates (--no-anon), the HSM rejects any client that connects without one. It accepts the TLS handshake and then closes the connection.