Skip to content

Obtaining a TLS Certificate

To enable TLS, you need a valid and trusted TLS certificate. You can obtain a free TLS certificate from Let’s Encrypt or purchase one from a trusted Certificate Authority (CA).

Fortunately, Iridium includes built-in support to generate certificates.

You can generate a self-signed certificate using the following command:

Terminal window
iridium cert generate example.com

This command will generate two files in the current directory, example.com.crt (the certificate) and example.com.key (the private key).

Iridium also includes built-in support for obtaining and renewing certificates from Let’s Encrypt. To use this feature, run the following command:

Terminal window
iridium cert obtain example.com

This command will generate two files in the current directory, example.com.crt (the certificate) and example.com.key (the private key).

Once you have obtained your TLS certificate and private key, you need to configure Iridium to use them. Update your config.yaml file with the paths to your certificate and key files:

config.yaml
tls:
cert_file: /path/to/the/certificate.crt
key_file: /path/to/the/private.key
  • cert_file: This should point to the full chain certificate file provided by your CA. It typically includes your domain’s certificate along with any intermediate certificates.
  • key_file: This should point to the private key file associated with your TLS certificate.