Skip to content

Instantly share code, notes, and snippets.

@omar2205
Created November 15, 2023 10:07
Show Gist options
  • Save omar2205/cb2887517699caf489e87c7086bfa691 to your computer and use it in GitHub Desktop.
Save omar2205/cb2887517699caf489e87c7086bfa691 to your computer and use it in GitHub Desktop.
Check HTTPs with Golang
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