From 965db6eaf55d141d4d62ddb7de27d1ed6202de0e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 14 May 2021 11:38:40 +0200 Subject: [PATCH] outposts/proxy: fix insecure TLS Skip closes #882 Signed-off-by: Jens Langhammer --- outpost/pkg/proxy/api_bundle.go | 12 ++++++------ swagger.yaml | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/outpost/pkg/proxy/api_bundle.go b/outpost/pkg/proxy/api_bundle.go index 4262b8a99..9b7a98cfa 100644 --- a/outpost/pkg/proxy/api_bundle.go +++ b/outpost/pkg/proxy/api_bundle.go @@ -80,19 +80,19 @@ func (pb *providerBundle) prepareOpts(provider *models.ProxyOutpostConfig) *opti ID: "default", URI: provider.InternalHost, Path: "/", - InsecureSkipTLSVerify: provider.InternalHostSslValidation, + InsecureSkipTLSVerify: !provider.InternalHostSslValidation, }, } } if provider.Certificate != nil { - pb.log.WithField("provider", provider.ClientID).Debug("Enabling TLS") + pb.log.WithField("provider", provider.Name).Debug("Enabling TLS") cert, err := pb.s.ak.Client.Crypto.CryptoCertificatekeypairsViewCertificate(&crypto.CryptoCertificatekeypairsViewCertificateParams{ Context: context.Background(), KpUUID: *provider.Certificate, }, pb.s.ak.Auth) if err != nil { - pb.log.WithField("provider", provider.ClientID).WithError(err).Warning("Failed to fetch certificate") + pb.log.WithField("provider", provider.Name).WithError(err).Warning("Failed to fetch certificate") return providerOpts } key, err := pb.s.ak.Client.Crypto.CryptoCertificatekeypairsViewPrivateKey(&crypto.CryptoCertificatekeypairsViewPrivateKeyParams{ @@ -100,17 +100,17 @@ func (pb *providerBundle) prepareOpts(provider *models.ProxyOutpostConfig) *opti KpUUID: *provider.Certificate, }, pb.s.ak.Auth) if err != nil { - pb.log.WithField("provider", provider.ClientID).WithError(err).Warning("Failed to fetch private key") + pb.log.WithField("provider", provider.Name).WithError(err).Warning("Failed to fetch private key") return providerOpts } x509cert, err := tls.X509KeyPair([]byte(cert.Payload.Data), []byte(key.Payload.Data)) if err != nil { - pb.log.WithField("provider", provider.ClientID).WithError(err).Warning("Failed to parse certificate") + pb.log.WithField("provider", provider.Name).WithError(err).Warning("Failed to parse certificate") return providerOpts } pb.cert = &x509cert - pb.log.WithField("provider", provider.ClientID).Debug("Loaded certificates") + pb.log.WithField("provider", provider.Name).Debug("Loaded certificates") } return providerOpts } diff --git a/swagger.yaml b/swagger.yaml index 26411c5ae..b15aa7b98 100755 --- a/swagger.yaml +++ b/swagger.yaml @@ -531,6 +531,11 @@ paths: description: '' required: false type: string + - name: ordering + in: query + description: Which field to use when ordering the results. + required: false + type: string - name: search in: query description: A search term.