mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4405] FRP with SSL/HTTPS failed to connect #3482
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#3482
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 @mdennyh on GitHub (Aug 25, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4405
Bug Description
I have a web service that runs behind NAT. It runs on regular http port 4000 (local) so that I can access it locally in my LAN with
http://<local.ip.address>:4000/I want to expose this service to the internet so I can access it with
https://<mydomain.ddns.net>:4000/. I already able to run it with regular http without SSLI rent a public Ubuntu server and run
frpsthere.I also use no-IP to provide the domain that I need (this case:
mydomain.ddns.netI already have SSL certificate from Let's Encrypt. It consists of 2 files:
fullchain.pemandprivkey.pem. I generate both usingcertbotfrom the local server.Using the configurations below, I unable to access the service at all although both
frpcandfrpsconfirm handshake.frpc Version
0.60.0
frps Version
0.60.0
System Architecture
linux/amd64
Configurations
frps.ini
frpc.ini
Logs
whenever I try to access
http://mydomain.ddns.net:4000/from the web browser thefrpsserver prints this:FPS log:
FRPC log:
I want to highlight the error line here :
[vhost/vhost.go:249] [bec077128920b93f] [https] new request host [mydomain.ddns.net] path [] httpUser []that line indicates a configuration error, but I still can't find any reference or clue as to what my error is. I don't use NGINX. I already check the firewall status of both 4000 and 4100 port
Steps to reproduce
...
Affected area
@fatedier commented on GitHub (Aug 26, 2024):
I am not familiar with the use of Let's Encrypt certificates; perhaps you can try searching Google to see if there is relevant information.
@mdennyh commented on GitHub (Aug 26, 2024):
so @fatedier If not Let's Encrypt, then what service do you usually use for SSL?
@mdennyh commented on GitHub (Aug 26, 2024):
This is what I did to obtain the Let's Encrypt certificate:
Install certbot
Generate the SSL Certificate
the command above gives me 2 files:
(Optional) To renew the certificate automatically
This is how I use Let's Encrypt for other project too
@fatedier commented on GitHub (Aug 26, 2024):
https://github.com/fatedier/frp?tab=readme-ov-file#tls
@mdennyh commented on GitHub (Aug 26, 2024):
I see. So FRP is incompatible with PEM Chain certificate which Includes all the necessary certificates (such as intermediary CA certificates) in one file. FRP need a root CA cert which
certbotsimply cannot generate.In development environment, I need to "act" as my own Certificate Authority by self-signing the CA with
opensslas your example in https://github.com/fatedier/frp?tab=readme-ov-file#tlsIn production, I cannot use
certbotand had to use another SSL provider that can give me separate files: individual root, intermediate, and end-entity certificate files.FRP need
certificate.crtandca.crtthat I get from SSL provider, also thecertificate.keythat I get from the server (while generating the CSR)@fatedier commented on GitHub (Aug 26, 2024):
If I understand correctly,
ca.crtis not required.@mdennyh commented on GitHub (Aug 26, 2024):
Do you mean that this line:
transport.tls.trustedCaFile = "ca.crt"not required ?@mdennyh commented on GitHub (Aug 26, 2024):
Finally it works!
I use the bundled SSL certificate provided by NoIP service but any providers would do.
I also had to update configuration file to TOML
frps.toml
yes the
transport.tls.trustedCaFile = "ca.crt"is not needed herefrpc.toml
Thank you
@lumen-novum commented on GitHub (Jun 4, 2025):
For anyone else who has this issue in the future, I would like to mention that the Let's Encrypt certificates from Certbot do work with frp. Using @mdennyh 's setup, all I had to do was set
certFileto cert.pem andkeyFileto privkey.pem.Works great with my setup.