mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2320] Error occurs with TLS encryption: [W] [service.go:103] login to server failed: session shutdown #1841
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#1841
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 @villivateur on GitHub (Mar 21, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2320
Version: 0.35.1
OS: Ubuntu 18.04 LTS
CPU architecture: AMD64
Everything went well until I want to change my FRP service to TLS enctrypted mode.
I started frps in server A, then start frpc in server B. server B shows the following log:
But nothing in server A:
I promise that before I add the TLS function, the frps and frpc worked well.
No more logs are available.
confile
The
frp.crtandca.pemare self-signed using openssl. I'm sure theCNinfrp.crtisfrp.example.com.Can you guess what caused this issue
I've tryed removing
tls_trusted_ca_file = /etc/frp/ca.pemline infrpc.ini. The frpc worked. But it seems that it does not work in TLS mode.So, I guess that frpc had errors in processing ca.pem. Did I do something wrong?
Checklist:
@yuyulei commented on GitHub (Mar 22, 2021):
can you follow tls_demo and try it again, I want to make sure whether some mistake happens when generating the certificates.
@villivateur commented on GitHub (Mar 22, 2021):
@yuyulei Thank you for your reply. I followed the tls_demo exactly and it worked (only replaced the
example.ca.comwhen generating the ca cert andserver.comwhen genarate the server cert).But I still want to know where I missed for generating the certs. I've followed this link (language: zh-cn) to do that, and set my frps server's hostname to
Common Namefield.Am I wrong? Or, how can I figure out where I am wrong? How can I debug in frpc?
session shutdownmeans nothing to me.@villivateur commented on GitHub (Mar 23, 2021):
BTW, I used the same certificate for frps and frpc. Will it cause session shutdown?
@zed76r commented on GitHub (Apr 29, 2021):
我也是同样的问题,多次连接的话可以看到提示是时间认证不通过:
但是两个证书通过openssl和windows的证书查看都是在有效期内的。
server.crt

ca.crt

我的证书也是根据TLS章节的内容生成的,只不过把CA的CN换成了别的名字,server证书的CN换成了我公网的IP。
另外,不确实是否相关,我通过s_client尝试获取服务器端证书的时候是没有的:
frps.ini
@zhanghe1993 commented on GitHub (May 21, 2021):
When FRPS and FRPC are in different countries, is it useful to create a certificate by way of tls_demo? According to the method tls_demo, my host in China can connect normally, but the host abroad cannot. Fortunately, it is working when I copy the ca and client files of the domestic client host to a foreign host.
@github-actions[bot] commented on GitHub (Jul 6, 2021):
Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.
@shagunkam commented on GitHub (Jan 11, 2024):
2024/01/11 12:03:03 [I] [root.go:141] start frpc service for config file [frpc.toml]
2024/01/11 12:03:03 [I] [service.go:287] try to connect to server...
2024/01/11 12:03:04 [W] [service.go:290] connect to server error: session shutdown
2024/01/11 12:03:04 [I] [root.go:159] frpc service for config file [frpc.toml] stopped
login to the server failed: session shutdown. With loginFailExit enabled, no additional retries will be attempted
serverAddr = "127.0.0.1"
serverPort = 7000
proxies
name = "test-tcp"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000
How i resolve this session shutdown. error?? anyone @villivateur
@vule20 commented on GitHub (Mar 14, 2024):
have you been able to solve it ? @shagunkam
@8ebb82 commented on GitHub (May 30, 2025):
Same error as @shagunkam. Anyone solve it?