mirror of
https://github.com/fatedier/frp.git
synced 2026-10-18 21:13:28 +08:00
feat(client): add useSystemCa and combine it with trustedCaFile (#5572)
Move the frpc-only TLS option into the shared TLSConfig as transport.tls.useSystemCa, replacing the unpublished useSystemRoots. When set, frpc verifies the server with the system CAs; when trustedCaFile is also set, its CAs are appended to the system pool so both are trusted. Failures to load either source abort the connection instead of falling back. Enabling the option without effective TLS is a configuration error, and the field is rejected in frps transport.tls and in both webServer.tls sections. Fixes #5545
This commit is contained in:
@@ -79,6 +79,10 @@ type TLSConfig struct {
|
||||
KeyFile string `json:"keyFile,omitempty"`
|
||||
// TrustedCaFile specifies the path of the trusted ca file that will load.
|
||||
TrustedCaFile string `json:"trustedCaFile,omitempty"`
|
||||
// UseSystemCa enables server certificate verification using system CAs.
|
||||
// If TrustedCaFile is also set, its certificates are added to the system CA pool.
|
||||
// Only supported in frpc's transport.tls. With neither trust source, frpc skips verification.
|
||||
UseSystemCa bool `json:"useSystemCa,omitempty"`
|
||||
// ServerName specifies the custom server name of tls certificate. By
|
||||
// default, server name if same to ServerAddr.
|
||||
ServerName string `json:"serverName,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user