Skip to content

Commit

Permalink
Merge branch 'master' into pptp
Browse files Browse the repository at this point in the history
  • Loading branch information
phillip-stephens authored Jan 25, 2025
2 parents fc3a081 + 015c8ed commit 3941c3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/http/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,15 @@ func (scan *scan) Grab() *zgrab2.ScanError {
}

// Application-specific logic for retrying HTTP as HTTPS; if condition matches, return protocol error
if scan.scanner.config.FailHTTPToHTTPS && scan.results.Response.StatusCode == 400 && readLen < 1024 && readLen > 24 {
bodyTextLen := int64(len(bodyText))
if scan.scanner.config.FailHTTPToHTTPS && scan.results.Response.StatusCode == 400 && bodyTextLen < 1024 && bodyTextLen > 24 {
// Apache: "You're speaking plain HTTP to an SSL-enabled server port"
// NGINX: "The plain HTTP request was sent to HTTPS port"
var sliceLen int64 = 128
if readLen < sliceLen {
sliceLen = readLen
}

bodyTextLen := int64(len(bodyText))
if bodyTextLen < sliceLen {
sliceLen = bodyTextLen
}
Expand Down

0 comments on commit 3941c3a

Please sign in to comment.