Created
January 24, 2018 13:46
-
-
Save sillyfellow/2f33627666af42cfbb11c537e9e23f2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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