mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #132] [MERGED] fix: respect ExternalSSLInsecure config in Langfuse client TLS #180
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/vxcontrol/pentagi/pull/132
Author: @mason5052
Created: 2/22/2026
Status: ✅ Merged
Merged: 2/23/2026
Merged by: @asdek
Base:
feature/project_improvements← Head:fix/langfuse-tls-respect-config📝 Commits (2)
9cedec5fix: respect ExternalSSLInsecure config in Langfuse client TLS86fc81bfix: use SystemCertPool as base when loading custom CA for Langfuse📊 Changes
1 file changed (+19 additions, -1 deletions)
View changed files
📝
backend/pkg/observability/lfclient.go(+19 -1)📄 Description
Description of the Change
Problem
NewLangfuseClientreceives*config.Configwhich provides two environment-variable-controlled fields for external TLS behavior:ExternalSSLInsecure(EXTERNAL_SSL_INSECURE, defaultfalse) - disables TLS verificationExternalSSLCAPath(EXTERNAL_SSL_CA_PATH, default empty) - path to a custom CA certificate bundleThe previous implementation hardcoded
InsecureSkipVerify: true, ignoring both config fields entirely. As a result:EXTERNAL_SSL_INSECUREwas not set (its secure default isfalse).EXTERNAL_SSL_CA_PATHwere never applied to Langfuse HTTP connections, making them ineffective for private Langfuse deployments with self-signed certificates.The same pattern was already correctly implemented in
backend/pkg/system/utils.gofor LLM provider HTTP clients.Solution
Mirror the existing pattern from
backend/pkg/system/utils.go:InsecureSkipVerifyfromcfg.ExternalSSLInsecure(secure by default:false)cfg.ExternalSSLCAPathis set, read the PEM file, parse it into anx509.CertPool, and set it asRootCAson the TLS configUsers who have
EXTERNAL_SSL_INSECURE=truein their environment retain the previous behavior.Ref: #101
Type of Change
Areas Affected
Testing and Verification
Test Steps
EXTERNAL_SSL_INSECURE=false(default): Langfuse TLS certificate is now verifiedEXTERNAL_SSL_INSECURE=true: existing behavior preserved (InsecureSkipVerify=true)EXTERNAL_SSL_CA_PATH=/path/to/ca.pem: custom CA is loaded and applied to Langfuse connectionsSecurity Considerations
EXTERNAL_SSL_INSECUREdefault offalseInsecureSkipVerify: trueshould setEXTERNAL_SSL_INSECURE=trueif their Langfuse instance uses a self-signed certificateEXTERNAL_SSL_CA_PATHfor certificate validation without disabling TLSDeployment Notes
If your self-hosted Langfuse instance uses a self-signed or private CA certificate:
EXTERNAL_SSL_CA_PATH=/path/to/ca.pemfor proper certificate validation, OREXTERNAL_SSL_INSECURE=trueto preserve the previous behaviorChecklist
Code Quality
go fmtandgo vet(for Go code)Security
Compatibility
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.