Skip to content

Instantly share code, notes, and snippets.

@sillyfellow
Created January 24, 2018 13:46
Show Gist options
  • Save sillyfellow/2f33627666af42cfbb11c537e9e23f2a to your computer and use it in GitHub Desktop.
Save sillyfellow/2f33627666af42cfbb11c537e9e23f2a to your computer and use it in GitHub Desktop.
package main
import (
"flag"
"net/http"
"time"
log "github.com/sirupsen/logrus"
)
func main() {
// Sample code to test for TLS values in http.GET response
client := &http.Client{Timeout: 10 * time.Second}
urlPtr := flag.String("url", "http://google.com", "provide url to try")
flag.Parse()
response, err := client.Get(*urlPtr)
if err != nil {
log.Fatalf("Get failed : %s", err)
}
defer response.Body.Close()
log.Infof("TLS Status (from %s): %v", *urlPtr, response.TLS)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment