Skip to content

Conversation

@vmaerten
Copy link
Member

@vmaerten vmaerten commented Nov 29, 2025

Summary

Fixes #2242

Add support for custom TLS certificates when fetching remote Taskfiles over HTTPS. This enables usage in corporate environments with internal CA certificates and mTLS (mutual TLS) authentication.

New CLI flags:

  • --cacert - Custom CA certificate for TLS verification
  • --cert - Client certificate for mTLS
  • --cert-key - Client certificate private key

New config options:

  remote:
    cacert: "/path/to/ca.crt"
    cert: "/path/to/client.crt"
    cert-key: "/path/to/client.key"

Design Decision: Functional Options Pattern

TLS configuration uses functional options (WithCACert(), WithCert(), etc.) rather than direct function parameters. This choice preserves API ergonomics for consumers of the taskfile package:

The TLS options are defined on baseNode (shared by all node types) rather than being HTTP-specific. While only HTTPNode uses these fields today, this design:

  1. Keeps the Package API simple and consistent
  2. Allows future extension (e.g., Git over HTTPS with custom certs)
  3. Avoids breaking API changes if other node types need TLS later

Why no --cert-key-pass?

Encrypted private keys are not supported in this PR. Reasons:

  1. Complexity: Go's stdlib only supports legacy PEM encryption (deprecated), and PKCS#8 encrypted keys require external dependencies or custom ASN.1 parsing
  2. Niche use case: Most mTLS setups use unencrypted keys (protected by filesystem permissions) or rely on secret managers
  3. Easy workaround: Users can decrypt their key beforehand with openssl rsa -in encrypted.key -out decrypted.key

This can be added later if there's demand.

@vmaerten vmaerten marked this pull request as ready for review December 6, 2025 08:54
@vmaerten vmaerten requested review from andreynering and pd93 December 6, 2025 08:54
@vmaerten vmaerten self-assigned this Dec 12, 2025
@vmaerten vmaerten added the area: remote Changes related to remote taskfiles. label Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: remote Changes related to remote taskfiles.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support self-signed certificates for remote taskfiles

1 participant