Last active
May 5, 2021 06:59
-
-
Save priesdelly/4ec46adcbcf5ab27c386c2a3a274fe56 to your computer and use it in GitHub Desktop.
Go http request to self signed domain (using direct go http) (credit: https://stackoverflow.com/questions/12122159/how-to-do-a-https-request-with-bad-certificate/12122718#12122718)
This file contains 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" | |
"crypto/tls" | |
) | |
func main() { | |
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} | |
_, err := http.Get("https://golang.org/") | |
if err != nil { | |
fmt.Println(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment