mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 06:05:25 +00:00
fixing tls config generation
This commit is contained in:
parent
a6798f37ad
commit
e7655f1df0
@ -138,24 +138,29 @@ func (request *Request) ExecuteWithResults(input string, dynamicValues, previous
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
var conn net.Conn
|
var conn net.Conn
|
||||||
zconfig := &ztls.Config{InsecureSkipVerify: true, ServerName: hostname}
|
|
||||||
if minVersion > 0 {
|
|
||||||
zconfig.MinVersion = minVersion
|
|
||||||
}
|
|
||||||
if maxVersion > 0 {
|
|
||||||
zconfig.MaxVersion = maxVersion
|
|
||||||
}
|
|
||||||
if len(zconfig.CipherSuites) > 0 {
|
|
||||||
zconfig.CipherSuites = cipherSuites
|
|
||||||
}
|
|
||||||
|
|
||||||
if request.options.Options.ZTLS {
|
if request.options.Options.ZTLS {
|
||||||
|
zconfig := &ztls.Config{InsecureSkipVerify: true, ServerName: hostname}
|
||||||
|
if minVersion > 0 {
|
||||||
|
zconfig.MinVersion = minVersion
|
||||||
|
}
|
||||||
|
if maxVersion > 0 {
|
||||||
|
zconfig.MaxVersion = maxVersion
|
||||||
|
}
|
||||||
|
if len(zconfig.CipherSuites) > 0 {
|
||||||
|
zconfig.CipherSuites = cipherSuites
|
||||||
|
}
|
||||||
conn, err = request.dialer.DialZTLSWithConfig(context.Background(), "tcp", addressToDial, zconfig)
|
conn, err = request.dialer.DialZTLSWithConfig(context.Background(), "tcp", addressToDial, zconfig)
|
||||||
} else {
|
} else {
|
||||||
var config *tls.Config
|
config := &tls.Config{InsecureSkipVerify: true, ServerName: hostname}
|
||||||
config, err = fastdialer.AsTLSConfig(zconfig)
|
if minVersion > 0 {
|
||||||
if err != nil {
|
config.MinVersion = minVersion
|
||||||
return err
|
}
|
||||||
|
if maxVersion > 0 {
|
||||||
|
config.MaxVersion = maxVersion
|
||||||
|
}
|
||||||
|
if len(config.CipherSuites) > 0 {
|
||||||
|
config.CipherSuites = cipherSuites
|
||||||
}
|
}
|
||||||
conn, err = request.dialer.DialTLSWithConfig(context.Background(), "tcp", addressToDial, config)
|
conn, err = request.dialer.DialTLSWithConfig(context.Background(), "tcp", addressToDial, config)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user