mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3484] tls_enable = true xtcp wsarecv: An existing connection was forcibly closed by the remote host. #2785
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#2785
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?
Originally created by @Gu-f on GitHub (Jun 10, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3484
Bug Description
当我开启了tls后,无法连接。删除client配置文件中的
tls_enable = true和server配置文件中的tls_only = true后正常连接。看了文档后我又生成了证书添加了证书配置,还是依然无法连接。
证书使用的是 DigiCert 免费版 SSL 证书。
证书下载下来后有三个文件,分别是:
mydomain.key
mydomain_chain.crt (这个我理解是证书链的中间证书,不确定是否等同于frp文档中提到的ca.crt根证书)
mydomain_public.crt
frpc Version
0.49.0
frps Version
0.49.0
System Architecture
frpc:win10 x64 , frps: linux/x86_64
Configurations
未指定证书的情况:
client:
server:
指定证书的情况:
client:
server:
Logs
不管是否指定证书报错一样,如下。
Steps to reproduce
Affected area
@limaofu commented on GitHub (Jun 12, 2023):
你可以参考cof-lee的方档: https://limaofu.github.io/
代理服务器操作手册-0607-back.docx
@Gu-f commented on GitHub (Jun 13, 2023):
感谢回答,出现这个问题我猜测大概率是证书的问题。通过文对比,有些疑问cof-lee的文档中的样例是否是一个双向验证的样例,是否等价于文档自定义TLS协议加密|frp 这部分提到的内容?。
我的疑问点在于,如果我使用的不是自签名证书,例如使用Let's Encrypt或者是DigiCert 生成的证书,我应该下载的是什么格式的证书,并且与frpc.ini和frps.ini中的配置项
tls_cert_file = frpc-1.xxxx.com.crt、tls_key_file = frpc-1.xxxx.com.key、tls_trusted_ca_file = frpca.crt如何对应,我感觉我在指定证书配置的时候没有指定正确,目前我对tls证书这块了解不深入,可以举个示例吗。比如说,我在DigiCert申请后,证书下载Apache类型后有三个文件,分别是:
mydomain.key
mydomain_chain.crt (这个我理解是证书链的中间证书,不确定是否等同于frp文档中提到的ca.crt根证书)
mydomain_public.crt
那么在frp配置中我应该如何指定
tls_cert_file、tls_key_file、tls_trusted_ca_file这三个配置项呢?或者说我需要下载其他类型的格式?
感谢帮助!
@fatedier commented on GitHub (Jun 13, 2023):
一般来说,非自签名的证书不需要配置
tls_trusted_ca_file。启用
tls_enable不配置证书的话,默认证书是自动生成的,如果这个连接不上,配置证书原理也是一样的。可有考虑 frpc 增加
disable_custom_tls_first_byte = true配置试试看,或者 protocol 使用 quic 也可以试一试。@Gu-f commented on GitHub (Jun 13, 2023):
好的,我增加
disable_custom_tls_first_byte = true试试。只启用tls_enable不配置证书的话试过了,是连接不上的,我印象在文档某个位置看到一条信息说是从某个版本后,启用tls_enable后必须要配置证书了,不确定该信息是否还有效。
@fatedier commented on GitHub (Jun 13, 2023):
你可以找一下是哪个文档
@Gu-f commented on GitHub (Jun 13, 2023):
试验结果如下:
增加
disable_custom_tls_first_byte = true无效,依然是同样的问题。protocol使用quic工作正常了,但是带来了一个新问题。使用quic后无论是否添加tls_enable、无论指定的证书是否正确(证书格式正确不是同一私钥签发的两张证书),都能成功与server建立连接。这是什么原因
@cxiaolng commented on GitHub (Jun 21, 2023):
frp_0.48.0 版本
tls_enable = true 不论是否开启,都一直报wsarecv: An existing connection was forcibly closed by the remote host.
frpc.ini增加disable_custom_tls_first_byte = true 有效
@github-actions[bot] commented on GitHub (Jul 22, 2023):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
@ac-sc commented on GitHub (Aug 10, 2023):
这个证书的问题,最终是怎样填的呢,看了下还是没理解到!
@limaofu commented on GitHub (Aug 16, 2023):
加我v信, Cof-Lee
On Thu, Aug 10, 2023, 12:38 aocheng @.***> wrote: