mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2642] tls: first record does not look like a TLS handshake error from frps #2106
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#2106
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 @drew2323 on GitHub (Oct 31, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2642
Bug Description
My goal
How i did it
I use simple configuration
server {
listen 80;
listen 443;
server_name sub.domain.com;
}
but then i get error 502 - bad gateway error from NGINX
2021/10/31 14:49:03 [error] 1151786#1151786: *15988 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 41.15.31.118, server: sub.domain.com, request: "GET / HTTP/1.1", upstream: "http://0.0.0.0:44300/", host: "ub.domain.com"
which is this error from FRPS log:
2021/10/31 13:30:04 [D] [vhost.go:147] get hostname from http/https request error: tls: first record does not look like a TLS handshake
Any ideas how to solve this?
frpc Version
0.38
frps Version
0.38
System Architecture
linux/amd63 on server, linux/arm64 on client
Configurations
frps.ini
[common]
server_addr = 151.60.129.11
server_port = 7000
vhost_https_port = 44300
frpc.ini
[local]
type = https
local_port = 8123
Logs
2021/10/31 13:30:04 [D] [vhost.go:147] get hostname from http/https request error: tls: first record does not look like a TLS handshake
Steps to reproduce
...
Affected area
@drew2323 commented on GitHub (Oct 31, 2021):
Well I was able to do workaround by forwarding whole TCP. Still i wonder why https didnt work.
@fatedier commented on GitHub (Nov 1, 2021):
Nginx will send http request to frps, so you'd better configure vhost_http_port and use type http in frp.
@drew2323 commented on GitHub (Nov 2, 2021):
@fatedier that worked! thanks
I also had to change my local server to serve http not https (otherwise i got "http proxy request error: EOF" from frps). Now nginx takes care of certificates and communicating with client over https, reverse proxying to frp and local server over http.