From f24e18c936d6c76d8c8a961ba135d450325c8e44 Mon Sep 17 00:00:00 2001 From: Quinn Klassen Date: Wed, 5 Jun 2024 15:17:47 -0700 Subject: [PATCH] Disable TLS for proxy connection --- harness/go/harness/runner.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/harness/go/harness/runner.go b/harness/go/harness/runner.go index 8ef4a288..9a90e309 100644 --- a/harness/go/harness/runner.go +++ b/harness/go/harness/runner.go @@ -86,20 +86,23 @@ func NewRunner(config RunnerConfig, feature *PreparedFeature) (*Runner, error) { }() // Create client + var err error + tlsCfg, err := LoadTLSConfig(r.ClientCertPath, r.ClientKeyPath) + if err != nil { + return nil, err + } + r.Feature.ClientOptions.HostPort = r.ServerHostPort if r.Feature.ClientUsesProxy { r.Feature.ClientOptions.HostPort = r.ProxyListenHostPort + } else { + // Don't use TLS for the proxy connection + r.Feature.ClientOptions.ConnectionOptions.TLS = tlsCfg } r.Feature.ClientOptions.Namespace = r.Namespace if r.Feature.ClientOptions.Logger == nil { r.Feature.ClientOptions.Logger = r.Log } - var err error - tlsCfg, err := LoadTLSConfig(r.ClientCertPath, r.ClientKeyPath) - if err != nil { - return nil, err - } - r.Feature.ClientOptions.ConnectionOptions.TLS = tlsCfg if r.Feature.BeforeDial != nil { if err = r.Feature.BeforeDial(r); err != nil { @@ -113,6 +116,7 @@ func NewRunner(config RunnerConfig, feature *PreparedFeature) (*Runner, error) { savedValue := r.Feature.ClientOptions.HostPort r.Feature.ClientOptions.HostPort = r.ServerHostPort + r.Feature.ClientOptions.ConnectionOptions.TLS = tlsCfg if r.DirectClient, err = client.Dial(r.Feature.ClientOptions); err != nil { return nil, fmt.Errorf("failed creating client: %w", err) }