@@ -86,20 +86,23 @@ func NewRunner(config RunnerConfig, feature *PreparedFeature) (*Runner, error) {
86
86
}()
87
87
88
88
// Create client
89
+ var err error
90
+ tlsCfg , err := LoadTLSConfig (r .ClientCertPath , r .ClientKeyPath )
91
+ if err != nil {
92
+ return nil , err
93
+ }
94
+
89
95
r .Feature .ClientOptions .HostPort = r .ServerHostPort
90
96
if r .Feature .ClientUsesProxy {
91
97
r .Feature .ClientOptions .HostPort = r .ProxyListenHostPort
98
+ } else {
99
+ // Don't use TLS for the proxy connection
100
+ r .Feature .ClientOptions .ConnectionOptions .TLS = tlsCfg
92
101
}
93
102
r .Feature .ClientOptions .Namespace = r .Namespace
94
103
if r .Feature .ClientOptions .Logger == nil {
95
104
r .Feature .ClientOptions .Logger = r .Log
96
105
}
97
- var err error
98
- tlsCfg , err := LoadTLSConfig (r .ClientCertPath , r .ClientKeyPath )
99
- if err != nil {
100
- return nil , err
101
- }
102
- r .Feature .ClientOptions .ConnectionOptions .TLS = tlsCfg
103
106
104
107
if r .Feature .BeforeDial != nil {
105
108
if err = r .Feature .BeforeDial (r ); err != nil {
@@ -113,6 +116,7 @@ func NewRunner(config RunnerConfig, feature *PreparedFeature) (*Runner, error) {
113
116
114
117
savedValue := r .Feature .ClientOptions .HostPort
115
118
r .Feature .ClientOptions .HostPort = r .ServerHostPort
119
+ r .Feature .ClientOptions .ConnectionOptions .TLS = tlsCfg
116
120
if r .DirectClient , err = client .Dial (r .Feature .ClientOptions ); err != nil {
117
121
return nil , fmt .Errorf ("failed creating client: %w" , err )
118
122
}
0 commit comments