Add TLS configuration options for VictoriaLogs connections - #86
Open
mkobozev wants to merge 1 commit into
Open
Conversation
Add two environment variables for instances that serve certificates not trusted by the system certificate store: - VL_INSTANCE_TLS_CA_FILE: path to a PEM-encoded CA bundle, appended to the system roots. The preferred way to trust an internal CA. - VL_INSTANCE_TLS_INSECURE_SKIP_VERIFY: disables certificate verification entirely. Meant for development and testing only, logs a warning when enabled. Both options are disabled by default and are mutually exclusive, so there is no behavior change for existing users. The customized transport belongs to a client owned by Config instead of replacing http.DefaultTransport, so that the settings apply only to requests to the VictoriaLogs instance. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mkobozev
force-pushed
the
feature/tls-skip-verify
branch
from
July 26, 2026 11:24
f8f5033 to
18e57b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds two environment variables for connecting to VictoriaLogs instances that
serve a TLS certificate which is not trusted by the system certificate store:
VL_INSTANCE_TLS_CA_FILEVL_INSTANCE_TLS_INSECURE_SKIP_VERIFYWhy is this needed?
On-premise and internal deployments often terminate TLS with a certificate
issued by a private CA. Today the MCP server cannot talk to such an instance
over HTTPS at all.
VL_INSTANCE_TLS_CA_FILEis the intended fix for that case, and matches whatthe VictoriaMetrics components already offer via
-*.tlsCAFile.VL_INSTANCE_TLS_INSECURE_SKIP_VERIFYis the escape hatch for development andtesting, mirroring
-*.tlsInsecureSkipVerify.Changes
cmd/mcp-victorialogs/config/config.go: parses both variables and builds an*http.Clientwith the resulting TLS settings.cmd/mcp-victorialogs/tools/utils.go:GetTextBodyForRequestuses the clientfrom the config. The
*config.Configparameter was already in the signaturebut unused.
cmd/mcp-victorialogs/main.go: logs a warning when verification is disabled.README.md: both variables added to the configuration table.cmd/mcp-victorialogs/config/config_test.go: subtests for defaults, valid andinvalid values, a valid CA bundle, a missing CA file, a CA file with no
certificates, and the mutually exclusive combination.
Notes
existing users. When neither is set,
http.DefaultClientis used exactly asbefore.
Configrather than replacinghttp.DefaultTransport, so disabling verification cannot leak into unrelatedoutbound requests.
InsecureSkipVerifywould silentlyignore
RootCAs, so setting both fails at startup instead.strconv.ParseBooland an invalid value fails atstartup, consistent with how
MCP_LOG_FORMAT,MCP_SERVER_MODEandMCP_HEARTBEAT_INTERVALare handled.if you would prefer that.