fixing tls config generation
@@ -138,6 +138,8 @@ func (request *Request) ExecuteWithResults(input string, dynamicValues, previous
return err
}
var conn net.Conn
+
+ if request.options.Options.ZTLS {
zconfig := &ztls.Config{InsecureSkipVerify: true, ServerName: hostname}
if minVersion > 0 {
zconfig.MinVersion = minVersion
@@ -148,14 +150,17 @@ func (request *Request) ExecuteWithResults(input string, dynamicValues, previous
if len(zconfig.CipherSuites) > 0 {
zconfig.CipherSuites = cipherSuites
}
-
- if request.options.Options.ZTLS {
conn, err = request.dialer.DialZTLSWithConfig(context.Background(), "tcp", addressToDial, zconfig)
} else {
- var config *tls.Config
- config, err = fastdialer.AsTLSConfig(zconfig)
- if err != nil {
- return err
+ config := &tls.Config{InsecureSkipVerify: true, ServerName: hostname}
+ if minVersion > 0 {
+ config.MinVersion = minVersion
+ }
+ if maxVersion > 0 {
+ config.MaxVersion = maxVersion
+ }
+ if len(config.CipherSuites) > 0 {
+ config.CipherSuites = cipherSuites
}
conn, err = request.dialer.DialTLSWithConfig(context.Background(), "tcp", addressToDial, config)
}
