diff --git a/ssllabs-scan-v3.go b/ssllabs-scan-v3.go index 092e61b..941a374 100644 --- a/ssllabs-scan-v3.go +++ b/ssllabs-scan-v3.go @@ -81,6 +81,8 @@ var globalMaxAge = 0 var globalInsecure = false +var globalPublish = false + var httpClient *http.Client type LabsError struct { @@ -635,6 +637,10 @@ func invokeAnalyze(host string, startNew bool, fromCache bool) (*LabsReport, err command = command + "&ignoreMismatch=on" } + if globalPublish { + command = command + "&publish=on" + } + resp, body, err := invokeApi(command) if err != nil { return nil, err @@ -1043,9 +1049,14 @@ func main() { var conf_maxage = flag.Int("maxage", 0, "Maximum acceptable age of cached results, in hours. A zero value is ignored.") var conf_verbosity = flag.String("verbosity", "info", "Configure log verbosity: error, notice, info, debug, or trace.") var conf_version = flag.Bool("version", false, "Print version and API location information and exit") + var conf_publish = flag.Bool("publish", false, "If assessment results should be published on the public results boards.") flag.Parse() + if *conf_publish { + globalPublish = *conf_publish + } + if *conf_version { fmt.Println(USER_AGENT) fmt.Println("API location: " + apiLocation) @@ -1173,7 +1184,7 @@ func main() { fmt.Println(",") } fmt.Println(results) - + } fmt.Println("]") }