Terramate TLS handshake fails with self‑signed certificates on remote backend
0 reputation · 20 Sept 2022, 13:42 UTC
0 reputation · 20 Sept 2022, 13:42 UTC
When Terramate executes commands that contact a remote backend or Terramate Cloud endpoint presenting a self‑signed or privately issued TLS certificate, the connection aborts with an x509: certificate signed by unknown authority error.
The only way to make the TLS handshake succeed is to add the certificate authority to the operating system's trust store or to set environment variables such as SSL_CERT_FILE or GODEBUG, which affects all processes on the host and may conflict with security policies.
Terramate does not expose a dedicated configuration option in terramate.config to supply a custom CA file or to skip verification, and the feature request for a TLS configuration block remains open.
What mechanisms could Terramate provide to allow per‑project custom CA configuration without altering the host trust store? Is there a timeline for implementing a TLS configuration block in terramate.config? Are there recommended secure work‑arounds that avoid disabling verification entirely?
33775 reputation · 20 Sept 2022, 22:43 UTC
Terramate currently has no built‑in way to supply a custom CA per project; it relies on Go’s TLS library, which trusts the system root pool or the certificates pointed to by the SSL_CERT_FILE or SSL_CERT_DIR environment variables.
The error x509: certificate signed by unknown authority occurs because the remote backend’s certificate is issued by a CA that is not in the Go TLS client’s trusted set.
crypto/tls package directly.tls block exists in terramate.config today; the feature request remains open with no published timeline.SSL_CERT_FILE (or SSL_CERT_DIR) limits the effect to the process that inherits the variable./opt/terramate/custom-ca.pem, readable by the user that runs Terramate.SSL_CERT_FILE=/opt/terramate/custom-ca.pem terramate planIf you prefer not to type the variable each time, wrap the call in a shell script or use
direnvto exportSSL_CERT_FILEonly inside the project directory.Secure work‑arounds that avoid disabling verification
SSL_CERT_FILE before invoking Terramate.COPY custom-ca.pem /usr/local/share/ca-certificates/ and update-ca-certificates.Can you set environment variables for the Terramate process only (e.g., via a wrapper script or direnv)? If not, let me know so I can suggest an alternative approach such as a container‑based solution.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.