Based on the provided files, it's not directly possible to establish an HTTPS connection between frpc and frps for the control channel (the tunnel itself). The configuration options for frpc and frps primarily focus on the transport layer for proxying user connections, not the underlying communication between the client and server.
Here's a breakdown of why:
-
Configuration Focus: The frp/pkg/config/v1/proxy.go file defines configurations for proxies (tcp, udp, http, https, etc.) and their transport options (useEncryption, useCompression, bandwidthLimit, etc.). These options relate to how data is transferred for the proxied connections, not how frpc connects to frps.
-
TLS for Proxied Connections: While the HTTPSProxy in frp/server/proxy/https.go and the https2http plugin example in README.md demonstrate the use of TLS/HTTPS for proxied user connections, this is different from securing the control channel. The frps listens for incoming connections on the specified bindPort and the client makes an outbound connection to the configured serverAddr on the serverPort, and there is no mention of TLS configuration for that control channel.
-
frpc and frps Communication: The core communication between frpc and frps is handled by transport.MessageTransporter (mentioned in frp/client/proxy/proxy.go), and it does not expose options for TLS. The frp client library's design does not seem to have explicit support for using HTTPS or TLS directly for communication with the frp server.
-
Server Plugin for Custom Auth: The server plugin mechanism (mentioned in frp/doc/server_plugin.md and frp/pkg/plugin/server/plugin.go) does not provide the ability to modify how the frpc connects to the server, it can only modify the behavior of the frps after the client is already connected. This is for user authentication, proxy creation etc., not for the control channel security.
Workarounds and Considerations:
While direct HTTPS for the control channel isn't available, here are some related approaches:
-
Encryption: frp supports encryption (useEncryption in ProxyTransport) for the data transmitted through the proxy connections. This secures the data being proxied, but not the control channel between frpc and frps.
-
TLS for HTTP/HTTPS Proxies: If you're using frp to proxy HTTP or HTTPS services, those proxied connections can have TLS enabled. In frp/README.md there is an example of https2http plugin.
-
Fronting with Cloudflare: If you are using Cloudflare, the client can connect to Cloudflare using standard HTTPS and Cloudflare can connect to the frps server using the standard frp protocol, this is not possible to configure in frp itself.
In Summary:
Direct HTTPS for the frpc to frps control channel is not a built-in feature. The focus is on securing the proxied connections. You can explore using encryption for the proxied data and TLS for HTTP/HTTPS proxies if applicable. The control channel is not configurable for TLS usage.