mirror of
https://github.com/fatedier/frp.git
synced 2025-05-08 15:38:27 +00:00
Compare commits
3 Commits
51fb85ae3b
...
18c56dcc9a
Author | SHA1 | Date | |
---|---|---|---|
|
18c56dcc9a | ||
|
b14192a8d3 | ||
|
e2b34fff62 |
@ -1,3 +1,5 @@
|
||||
### Features
|
||||
|
||||
* The frpc visitor command-line parameter adds the `--server-user` option to specify the username of the server-side proxy to connect to.
|
||||
|
||||
* Support multiple frpc instances with different subjects when using oidc authentication.
|
@ -103,6 +103,7 @@ type HTTP2HTTPSPluginOptions struct {
|
||||
LocalAddr string `json:"localAddr,omitempty"`
|
||||
HostHeaderRewrite string `json:"hostHeaderRewrite,omitempty"`
|
||||
RequestHeaders HeaderOperations `json:"requestHeaders,omitempty"`
|
||||
RootCA string `json:"rootCA,omitempty"`
|
||||
}
|
||||
|
||||
func (o *HTTP2HTTPSPluginOptions) Complete() {}
|
||||
@ -137,6 +138,7 @@ type HTTPS2HTTPSPluginOptions struct {
|
||||
EnableHTTP2 *bool `json:"enableHTTP2,omitempty"`
|
||||
CrtPath string `json:"crtPath,omitempty"`
|
||||
KeyPath string `json:"keyPath,omitempty"`
|
||||
RootCA string `json:"rootCA,omitempty"`
|
||||
}
|
||||
|
||||
func (o *HTTPS2HTTPSPluginOptions) Complete() {
|
||||
|
@ -19,11 +19,13 @@ package plugin
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"io"
|
||||
stdlog "log"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"os"
|
||||
|
||||
"github.com/fatedier/golib/pool"
|
||||
|
||||
@ -53,8 +55,23 @@ func NewHTTP2HTTPSPlugin(options v1.ClientPluginOptions) (Plugin, error) {
|
||||
l: listener,
|
||||
}
|
||||
|
||||
tr := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
tr := &http.Transport{}
|
||||
|
||||
if opts.RootCA != "" {
|
||||
caCert, err := os.ReadFile(opts.RootCA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
caCertPool, err := x509.SystemCertPool()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
caCertPool.AppendCertsFromPEM(caCert)
|
||||
tr.TLSClientConfig = &tls.Config{
|
||||
RootCAs: caCertPool,
|
||||
}
|
||||
} else {
|
||||
tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
}
|
||||
|
||||
rp := &httputil.ReverseProxy{
|
||||
|
@ -19,12 +19,14 @@ package plugin
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"io"
|
||||
stdlog "log"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/fatedier/golib/pool"
|
||||
@ -58,8 +60,23 @@ func NewHTTPS2HTTPSPlugin(options v1.ClientPluginOptions) (Plugin, error) {
|
||||
l: listener,
|
||||
}
|
||||
|
||||
tr := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
tr := &http.Transport{}
|
||||
|
||||
if opts.RootCA != "" {
|
||||
caCert, err := os.ReadFile(opts.RootCA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
caCertPool, err := x509.SystemCertPool()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
caCertPool.AppendCertsFromPEM(caCert)
|
||||
tr.TLSClientConfig = &tls.Config{
|
||||
RootCAs: caCertPool,
|
||||
}
|
||||
} else {
|
||||
tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
}
|
||||
|
||||
rp := &httputil.ReverseProxy{
|
||||
|
Loading…
x
Reference in New Issue
Block a user