Transport Layer Security (TLS) is a cryptographic protocol that secures communication over a network. TLS is the successor to deprecated Secure-Sockets-Layer (SSL). Learn how to configure Spice to use TLS for encryption in transit.
A valid TLS certificate and private key in PEM format are required. To generate certificates for testing, follow the TLS Cookbook.
Use --tls-enabled true to enable TLS from the command line. The arguments --tls-certificate-file and --tls-key-file specify the paths to the certificate and private key files.
Alternatively, to pass PEM-encoded certificate and private key strings directly, use the --tls-certificate and --tls-key arguments.
When using the Spice CLI, arguments, including the TLS arguments, are passed to spice run automatically.
Note that -- is used to separate the spice run arguments from the Spice runtime arguments.
Use the tls section as a child to runtime to provide the certificate and key files/strings.
To learn more about secrets, see Secret Stores.
:::info
Changes to TLS configuration are not applied at runtime and will only take effect on startup.
:::
When TLS is enabled, the runtime output will print the TLS certificate details.
When TLS is enabled in the runtime, the Spice CLI can be configured to connect to the runtime using TLS by specifying the --tls-root-certificate-file argument, providing the path to the root certificate file.