mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[PR #4722] [CLOSED] Added support for HTTPS client certificate authentication #5037
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#5037
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?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/4722
Author: @leogcurvelo
Created: 3/23/2025
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (3)
acb53acAdded optional HTTPS client certificate authentication to https2http and https2httpsa1532e9Updated README.md: HTTPS client authenticationb365891Updated README.md: HTTPS client authentication📊 Changes
6 files changed (+319 additions, -77 deletions)
View changed files
📝
README.md(+41 -2)📝
pkg/config/v1/plugin.go(+16 -14)📝
pkg/plugin/client/https2http.go(+28 -0)📝
pkg/plugin/client/https2https.go(+28 -0)📝
pkg/transport/tls.go(+26 -0)📝
test/e2e/v1/plugin/client.go(+180 -61)📄 Description
WHY
While a proxy of "http" type can be protected by "httpUser" and "httpPassword", no such protection is provided for "https" proxies. This leaves them unprotected in case someone guesses the URL, the URL leaks, or someone looks over your shoulder; as a system administrator, you would want to put yet another reverse proxy in front of the service to protect it, or if possible modify the actual service to ask for username and password.
This lack of support for HTTP Basic Authentication on HTTPS proxies has been talked about as a technical limitation:
https://github.com/fatedier/frp/issues/3242#issuecomment-1374694878
And due to my novice skills in Go, I took that to heart and didn't even think of intercepting the encrypted connection, so I turned to the next best thing: HTTPS client certificate authentication, which is done at the TLS configuration level.
This PR adds a new "clientCertificates" configuration to "https2http" and "https2https" plugins, as such:
Multiple, self-signed, certificates can be set in this configuration, and at least one of them will be required to access the service. The client certificate can normally be installed at system-level or at application-level, at the discretion of the user.
Below is a demonstration of the feature using the Vivaldi browser, with a self-signed certificate installed at system-level:
frp_demo.webm
While this form of authentication is not common like Basic Authentication, it does provide security benefits, and I think they're worth considering as well:
https://en.wikipedia.org/wiki/Mutual_authentication#Defenses
Finally, I have updated the README to reflect these changes with instructions; and created two new e2e tests, separate from the existing https2http and https2https tests, specifically for client certificate authentication.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.