[GH-ISSUE #4551] Encryption和Compression选项启用无效 #3596

Closed
opened 2026-05-05 14:18:32 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @Metroyy on GitHub (Nov 22, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4551

Bug Description

问题描述

使用手册文档中的transport.useEncryption = truetransport.useCompression = true配置后,在日志文件和仪表盘中查看传输,其输出还是false,tls疑似没生效,抓包后没有看到握手痕迹:

2024-11-22 10:22:10.286 [T] [proxy/proxy.go:144] [08f2e9c6edc4e245] [[proxies]] handle tcp work connection, useEncryption: false, useCompression: false

微信截图_20241122103040

frpc Version

0.61.0

frps Version

0.61.0

System Architecture

debian12/amd64,win11/amd64

Configurations

frpc.toml配置

[common]
# 服务端地址
server_addr = "xxx"
# 服务端端口
server_port = 7000
# Token身份验证
token = "xxx"
# tls加密
transport.tls.enable = true
transport.tls.cert_file = "C:\\Users\\YY\\Desktop\\frp_0.61.0_windows_amd64\\tls\\client.crt"
transport.tls.key_file = "C:\\Users\\YY\\Desktop\\frp_0.61.0_windows_amd64\\tls\\client.key"
transport.tls.trusted_ca_file = "C:\\Users\\YY\\Desktop\\frp_0.61.0_windows_amd64\\tls\\ca.crt"
# 日志文件路径
log_file = "./frpc.log"
log_level = "trace"
log_max_days = 3

# TCP 代理配置
[[proxies]]
name = "test-tcp"
type = "tcp"
local_ip = "127.0.0.1"
local_port = 80
remote_port = 60001
transport.use_encryption = true
transport.use_compression = true

frps.toml配置

[common]
# 绑定的端口号
bind_port = 7000
# Token身份验证
token = "xxx"
# 管理面板 默认为 127.0.0.1,如果需要公网访问,需要修改为 0.0.0.0。
dashboard_addr = "0.0.0.0"
dashboard_port = 7500
dashboard_user = "admin"
dashboard_pwd = "admin"
# tls加密
transport.tls.certFile = "/home/frp/tls/server.crt"
transport.tls.keyFile = "/home/frp/tls/server.key"
transport.tls.trustedCaFile = "/home/frp/tls/ca.crt"
# 是否只接受 TLS 加密连接
transport.tls.force = true
tls_enable = true
use_encryption = true  # 启用加密
use_compression = true  # 启用压缩
# 日志路径
log_file = "./frps.log"
log_level = "trace"
log_max_days = 3

疑惑

不知道是我写错了吗,启用面板用文档手册的方法不行:

webServer.addr = "0.0.0.0"
webServer.port = 7500
# dashboard 用户名密码,可选,默认为空
webServer.user = "admin"
webServer.password = "admin"

使用chat给的另一种写法就可以:

dashboard_addr = "0.0.0.0"
dashboard_port = 7500
dashboard_user = "admin"
dashboard_pwd = "admin"

日志也是同样的,文档手册的写法不生效:

log.to = "./frpc.log"
log.level = "trace"
log.maxDays = 3

使用chat给的写法可以生效:

log_file = "./frps.log"
log_level = "trace"
log_max_days = 3

关于加密和压缩,chat给了另一种写法,我也尝试过,还是没有生效,日志和仪表盘中还是输出false:

# 在全局中写
use_encryption = true  # 启用加密
use_compression = true # 启用压缩

Logs

日志如下:

2024-11-22 10:22:10.286 [D] [proxy/proxy_wrapper.go:260] [08f2e9c6edc4e245] [[proxies]] start a new work connection, localAddr: 192.168.1.102:28487 remoteAddr: xxx:7000
2024-11-22 10:22:10.286 [T] [proxy/proxy.go:144] [08f2e9c6edc4e245] [[proxies]] handle tcp work connection, useEncryption: false, useCompression: false
2024-11-22 10:22:10.286 [D] [proxy/proxy.go:210] [08f2e9c6edc4e245] [[proxies]] join connections, localConn(l[127.0.0.1:28495] r[127.0.0.1:80]) workConn(l[192.168.1.102:28487] r[xxx:7000])
2024-11-22 10:22:10.288 [D] [proxy/proxy.go:222] [08f2e9c6edc4e245] [[proxies]] join connections closed

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @Metroyy on GitHub (Nov 22, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4551 ### Bug Description ### 问题描述 使用手册文档中的`transport.useEncryption = true`和`transport.useCompression = true`配置后,在日志文件和仪表盘中查看传输,其输出还是false,tls疑似没生效,抓包后没有看到握手痕迹: ``` 2024-11-22 10:22:10.286 [T] [proxy/proxy.go:144] [08f2e9c6edc4e245] [[proxies]] handle tcp work connection, useEncryption: false, useCompression: false ``` ![微信截图_20241122103040](https://github.com/user-attachments/assets/e710b987-b228-4dd8-a88e-44b59209f45e) ### frpc Version 0.61.0 ### frps Version 0.61.0 ### System Architecture debian12/amd64,win11/amd64 ### Configurations ### frpc.toml配置 ``` [common] # 服务端地址 server_addr = "xxx" # 服务端端口 server_port = 7000 # Token身份验证 token = "xxx" # tls加密 transport.tls.enable = true transport.tls.cert_file = "C:\\Users\\YY\\Desktop\\frp_0.61.0_windows_amd64\\tls\\client.crt" transport.tls.key_file = "C:\\Users\\YY\\Desktop\\frp_0.61.0_windows_amd64\\tls\\client.key" transport.tls.trusted_ca_file = "C:\\Users\\YY\\Desktop\\frp_0.61.0_windows_amd64\\tls\\ca.crt" # 日志文件路径 log_file = "./frpc.log" log_level = "trace" log_max_days = 3 # TCP 代理配置 [[proxies]] name = "test-tcp" type = "tcp" local_ip = "127.0.0.1" local_port = 80 remote_port = 60001 transport.use_encryption = true transport.use_compression = true ``` ### frps.toml配置 ``` [common] # 绑定的端口号 bind_port = 7000 # Token身份验证 token = "xxx" # 管理面板 默认为 127.0.0.1,如果需要公网访问,需要修改为 0.0.0.0。 dashboard_addr = "0.0.0.0" dashboard_port = 7500 dashboard_user = "admin" dashboard_pwd = "admin" # tls加密 transport.tls.certFile = "/home/frp/tls/server.crt" transport.tls.keyFile = "/home/frp/tls/server.key" transport.tls.trustedCaFile = "/home/frp/tls/ca.crt" # 是否只接受 TLS 加密连接 transport.tls.force = true tls_enable = true use_encryption = true # 启用加密 use_compression = true # 启用压缩 # 日志路径 log_file = "./frps.log" log_level = "trace" log_max_days = 3 ``` ### 疑惑 不知道是我写错了吗,启用面板用文档手册的方法不行: ``` webServer.addr = "0.0.0.0" webServer.port = 7500 # dashboard 用户名密码,可选,默认为空 webServer.user = "admin" webServer.password = "admin" ``` 使用chat给的另一种写法就可以: ``` dashboard_addr = "0.0.0.0" dashboard_port = 7500 dashboard_user = "admin" dashboard_pwd = "admin" ``` 日志也是同样的,文档手册的写法不生效: ``` log.to = "./frpc.log" log.level = "trace" log.maxDays = 3 ``` 使用chat给的写法可以生效: ``` log_file = "./frps.log" log_level = "trace" log_max_days = 3 ``` 关于加密和压缩,chat给了另一种写法,我也尝试过,还是没有生效,日志和仪表盘中还是输出false: ``` # 在全局中写 use_encryption = true # 启用加密 use_compression = true # 启用压缩 ``` ### Logs ### 日志如下: ``` 2024-11-22 10:22:10.286 [D] [proxy/proxy_wrapper.go:260] [08f2e9c6edc4e245] [[proxies]] start a new work connection, localAddr: 192.168.1.102:28487 remoteAddr: xxx:7000 2024-11-22 10:22:10.286 [T] [proxy/proxy.go:144] [08f2e9c6edc4e245] [[proxies]] handle tcp work connection, useEncryption: false, useCompression: false 2024-11-22 10:22:10.286 [D] [proxy/proxy.go:210] [08f2e9c6edc4e245] [[proxies]] join connections, localConn(l[127.0.0.1:28495] r[127.0.0.1:80]) workConn(l[192.168.1.102:28487] r[xxx:7000]) 2024-11-22 10:22:10.288 [D] [proxy/proxy.go:222] [08f2e9c6edc4e245] [[proxies]] join connections closed ``` ### Steps to reproduce 1. 2. 3. ... ### Affected area - [X] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@fatedier commented on GitHub (Nov 22, 2024):

https://github.com/fatedier/frp/blob/dev/README.md

首页即文档,请完全参考文档编写配置。

<!-- gh-comment-id:2492786936 --> @fatedier commented on GitHub (Nov 22, 2024): https://github.com/fatedier/frp/blob/dev/README.md 首页即文档,请完全参考文档编写配置。
Author
Owner

@Matthew-Harris-36 commented on GitHub (Dec 16, 2024):

@Metroyy 我也遇到了这个问题,发现官网给的配置参数不对。比如 vhostHTTPSPort 就监听不了端口。
你是怎么安装的啊?我无论是服务端还是客户端都是用的这个Docker镜像 https://hub.docker.com/r/snowdreamtech/frpc
你说有没有可能是Docker作者的问题?

<!-- gh-comment-id:2545251625 --> @Matthew-Harris-36 commented on GitHub (Dec 16, 2024): @Metroyy 我也遇到了这个问题,发现官网给的配置参数不对。比如 vhostHTTPSPort 就监听不了端口。 你是怎么安装的啊?我无论是服务端还是客户端都是用的这个Docker镜像 https://hub.docker.com/r/snowdreamtech/frpc 。 你说有没有可能是Docker作者的问题?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3596
No description provided.