diff --git a/internal/outpost/proxyv2/application/mode_proxy.go b/internal/outpost/proxyv2/application/mode_proxy.go index fa5f13fbc..a5fabb09d 100644 --- a/internal/outpost/proxyv2/application/mode_proxy.go +++ b/internal/outpost/proxyv2/application/mode_proxy.go @@ -1,17 +1,26 @@ package application import ( + "context" + "crypto/tls" "net/http" "net/http/httputil" "net/url" "time" "github.com/prometheus/client_golang/prometheus" + "goauthentik.io/internal/outpost/ak" "goauthentik.io/internal/outpost/proxyv2/metrics" "goauthentik.io/internal/outpost/proxyv2/templates" "goauthentik.io/internal/utils/web" ) +func (a *Application) getUpstreamTransport() http.RoundTripper { + return &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: *a.proxyConfig.InternalHostSslValidation}, + } +} + func (a *Application) configureProxy() error { // Reverse proxy to the application server u, err := url.Parse(*a.proxyConfig.InternalHost) @@ -19,6 +28,7 @@ func (a *Application) configureProxy() error { return err } rp := &httputil.ReverseProxy{Director: a.proxyModifyRequest(u)} + rp.Transport = ak.NewTracingTransport(context.TODO(), a.getUpstreamTransport()) rp.ErrorHandler = NewProxyErrorHandler(templates.GetTemplates()) rp.ModifyResponse = a.proxyModifyResponse a.mux.PathPrefix("/").HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {