mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 04:35:24 +00:00
Changed suffix to prefix tls://
This commit is contained in:
parent
7b4eef2d53
commit
a502847621
@ -56,14 +56,14 @@ func (r *Request) GetID() string {
|
||||
|
||||
// Compile compiles the protocol request for further execution.
|
||||
func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
||||
var err error
|
||||
var shouldUseTLS bool
|
||||
var err error
|
||||
|
||||
for _, address := range r.Address {
|
||||
// check if the connection should be encrypted
|
||||
shouldUseTLS = false
|
||||
if strings.HasSuffix(address, tlsSuffix) {
|
||||
if strings.HasPrefix(address, "tls://") {
|
||||
shouldUseTLS = true
|
||||
address = strings.TrimSuffix(address, tlsSuffix)
|
||||
address = strings.TrimPrefix(address, "tls://")
|
||||
}
|
||||
if strings.Contains(address, ":") {
|
||||
addressHost, addressPort, err := net.SplitHostPort(address)
|
||||
@ -98,5 +98,3 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
||||
func (r *Request) Requests() int {
|
||||
return len(r.Address)
|
||||
}
|
||||
|
||||
const tlsSuffix = ":tls"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user