mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[PR #5133] [CLOSED] fix: respect explicit transport.tls.force = false when trustedCaFile is set #5142
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/fatedier/frp/pull/5133
Author: @tensorworkerr
Created: 1/16/2026
Status: ❌ Closed
Base:
dev← Head:fix/tls-force-config-override📝 Commits (1)
73e4d1ffix: respect explicit transport.tls.force = false when trustedCaFile is set (#5131)📊 Changes
6 files changed (+53 additions, -7 deletions)
View changed files
📝
pkg/config/flags.go(+1 -1)📝
pkg/config/legacy/conversion.go(+1 -1)📝
pkg/config/v1/server.go(+3 -3)📝
pkg/config/v1/server_test.go(+44 -0)📝
server/api/controller.go(+3 -1)📝
server/service.go(+1 -1)📄 Description
WHY
Fixes #5131
When
transport.tls.force = falseis explicitly set infrps.tomlalongsidetransport.tls.trustedCaFile, the server incorrectly rejected non-TLS connections.Root Cause
In
ServerTransportConfig.Complete(), the code unconditionally setForce = truewheneverTrustedCaFilewas configured, ignoring the user's explicit setting.Solution
Changed
TLSServerConfig.Forcefromboolto*boolto distinguish between unset (nil) and explicitly set false. Now the default is only applied whenForceis nil.Changes
pkg/config/v1/server.go- ChangedForcetype and fixedComplete()pkg/config/flags.go- Updated CLI flag bindingpkg/config/legacy/conversion.go- Uselo.ToPtr()for conversionserver/api/controller.go- Uselo.FromPtr()for API responseserver/service.go- Uselo.FromPtr()for TLS checkpkg/config/v1/server_test.go- Added 4 test casesBackward Compatibility
Fully backward compatible - only the explicit
force = falsecase is now respected.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.