TrueNAS Scale Certificates

Last Edit: 2024.08.28

Overview

Add additional certificates to use for the web GUI on TrueNAS Scale.

Assumptions

DNS Authenticator

Add a new DNS authenticator for LetsEncrypt to use when generating a certificate for the domain. TrueNAS Scale supports Cloudflare, Route53, and OVH with simple configuration. Alternatively, a shell script can be used with any providers.

Cloudflare API Token

Create an API token to interact with a Cloudflare Zone.

Navigate to the My Profile page and select the API Tokens tab.

Select Create Token. Configure the token with permission to edit Zone DNS. Only allow access to the zone resource required.

SettingValueDescription
Token Nameexample-api-tokenChoose a name to identify the token.
PermissionsZone - DNS - EditGrant edit permissions for zone DNS.
Zone ResourcesInclude - Specific - example.comOnly include the zone that will utilize the token.

Cloudflare API token creation tool.

Continue to summary and review the configuration, select Create Token.

When presented, copy the generated Cloudflare API token.

Cloudflare API token.

Add Authenticator

Navigate to the TrueNAS Certificates dashboard, found under Credentials in the menu.

From the Certificates dashboard, select Add in the ACME DNS-Authenticators section. Configure the authenticator with the generated API token from the DNS provider.

SettingValueDescription
Namecloudflare-acmeAuthenticator identifier.
AuthenticatorcloudflareDNS provider to use for ACME challenges.
Cloudflare EmailLeave blank when using API token.
API KeyLeave blank when using API token.
API TokenGeneratedCloudflareAPITokenAPI token with DNS edit permissions for the domain.

Certificate Signing Request

From the Certificates dashboard, select Add in the Certificate Signing Requests section. Configure the signing request for the domain of choice, truenas.example.com.

SettingValueDescription
Identifier and Type
Nameletsencrypt-csrCSR identifier.
TypeCertificate Signing RequestCertificate request type.
ProfilesHTTPS RSA CertificateTemplate for the request, use RSA for LetsEncrypt.
Certificate Options
Key TypeRSAAlgorithm, use RSA for LetsEncrypt.
Key Length4096Select a key length >= 2048.
Digest AlgorithmSHA384Select a digest algorithm >= SHA256.
Certificate Subject
CountryUSASelect local country.
State.Optional, use period to leave empty.
Locality.Optional, use period to leave empty.
Organization.Optional, use period to leave empty.
Organizational UnitOptional.
Email[email protected]Administrative email for the certificate, will be sent with the request.
Common NameSystem FQDN, optional.
Subject Alternative Namestruenas.example.comWhen generating a certificate just for TrueNAS to use, specify a hostname. Formerly a wildcard cert that could be used for applications, but that functionality was depreciated.
Extra Constraints
Basic ContraintstrueLeave as configured by the ‘Profiles’ definition.
Extended Key UsagetrueLeave as configured by the ‘Profiles’ definition.
Key UsagetrueLeave as configured by the ‘Profiles’ definition.

Generate Certificate

With the DNS authenticator and Certificate Signing Request configured, the certificate can now be generated.

Admin Email

TrueNAS requires that an email address be configured for the admin user for an ACME challenege to be initiated.

From the TrueNAS menu, navigate to Credentials, Local Users, and select Edit for the admin user. Assign an email address for the user, [email protected]. Consider using the same email from the signing request.

Create ACME Certificate

Select the wrench icon next to the created certificate signing request, letsencrypt-csr.

TrueNAS Certificates dashboard.

Configure the certificate.

SettingValueDescription
Identifierletsencrypt-certIdentifier for the certificate.
Terms of ServicetrueAgree to the LetsEncrypt Terms of Service.
Renew Certificate Days10Days before expiry to renew the certificate.
ACME Server Directory URILet's Encrypt Production DirectorySelect the production or staging directory. Use staging when testing to avoid getting rate-limited.
Domains
DNS:truenas.example.comcloudflare-acmeSelect the configured DNS authenticator token.

Save the certificate configuration and the generation process will begin. This will take a few minutes.

The newly created certificate will show up in the Certificates section of the dashboard.

TrueNAS Certificates dashboard with new certificate.

Configure Web GUI

After generating the certificate, instruct TrueNAS to utilize it for the web GUI.

Navigate to System Settings, General, and select Settings in the GUI section.

Modify the GUI SSL Certificate configuration, switching from truenas_default to letsencrypt-cert.

TrueNAS web GUI certificate configuration.

References

1 2 3