Created
November 15, 2023 10:07
-
-
Save omar2205/cb2887517699caf489e87c7086bfa691 to your computer and use it in GitHub Desktop.
Check HTTPs with Golang
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 ( | |
"fmt" | |
"net/http" | |
) | |
var urls = []string{ | |
"https://expired.badssl.com/", | |
"https://oskr.nl", | |
} | |
func main() { | |
for _, url := range urls { | |
response, err := http.Get(url) | |
if err != nil || response.TLS == nil { | |
fmt.Println(url, ": HTTPs is not correctly setup") | |
} else { | |
fmt.Println(url, ": HTTPs looks OK") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment