mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-23 23:05: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.
|
// Compile compiles the protocol request for further execution.
|
||||||
func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
||||||
var err error
|
|
||||||
var shouldUseTLS bool
|
var shouldUseTLS bool
|
||||||
|
var err error
|
||||||
|
|
||||||
for _, address := range r.Address {
|
for _, address := range r.Address {
|
||||||
// check if the connection should be encrypted
|
// check if the connection should be encrypted
|
||||||
shouldUseTLS = false
|
if strings.HasPrefix(address, "tls://") {
|
||||||
if strings.HasSuffix(address, tlsSuffix) {
|
|
||||||
shouldUseTLS = true
|
shouldUseTLS = true
|
||||||
address = strings.TrimSuffix(address, tlsSuffix)
|
address = strings.TrimPrefix(address, "tls://")
|
||||||
}
|
}
|
||||||
if strings.Contains(address, ":") {
|
if strings.Contains(address, ":") {
|
||||||
addressHost, addressPort, err := net.SplitHostPort(address)
|
addressHost, addressPort, err := net.SplitHostPort(address)
|
||||||
@ -98,5 +98,3 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
|||||||
func (r *Request) Requests() int {
|
func (r *Request) Requests() int {
|
||||||
return len(r.Address)
|
return len(r.Address)
|
||||||
}
|
}
|
||||||
|
|
||||||
const tlsSuffix = ":tls"
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user