mirror of
https://github.com/fosrl/newt.git
synced 2026-03-09 07:12:28 -05:00
[PR #143] [MERGED] Mlts pkcs12 compatibility #142
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/newt/pull/143
Author: @rgutmen
Created: 9/19/2025
Status: ✅ Merged
Merged: 9/20/2025
Merged by: @oschwartz10612
Base:
dev← Head:mlts-pkcs12-compatibility📝 Commits (4)
0fc13befeat(Docs): Addding GoReport Badgea08a3b9feat(Docs): Add License Badge and PkgGo Badgec673743Merge pull request #142 from marcschaeferger/main9bd96acSupport TLS_CLIENT_CERT, TLS_CLIENT_KEY and TLS_CA_CERT in Docker Compose📊 Changes
2 files changed (+4 additions, -1 deletions)
View changed files
📝
README.md(+3 -0)📝
main.go(+1 -1)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
In our Docker Compose setup for mTLS, the recommended configuration is to pass the three PEM-based variables:
However, the current code path has an unintended fallback: when TLS_CLIENT_CERT_PKCS12 is unset or empty, it automatically treats TLS_CLIENT_CERT as the certificate source and ignores TLS_CLIENT_KEY and TLS_CA_CERT even if they are provided. This makes the PEM triplet unusable and forces a pseudo-PKCS#12 behavior when it shouldn’t.
Observed error / symptom
Important scope note (not affected)
This issue does not occur when running the binary directly with CLI flags, e.g.:
With explicit flags, the PEM triplet works as expected. The problem is specific to the environment-variable–driven configuration commonly used in Docker Compose.
How to test?
PEM triplet via Docker Compose
Create three test files (client.crt, client.key, ca.crt).
Run the service with:
PKCS#12 via Docker Compose
Create a client.p12 (same material as above).
Run the service with:
Expected: both PEM triplet and PKCS#12 paths work; when PKCS#12 is unset, the PEM triplet is honored.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.