How to Make HTTPS Requests with Custom TLS in Go

Web
Configure a custom http.Transport with a tls.Config to handle specific TLS requirements for HTTPS requests in Go.

To make HTTPS requests with custom TLS in Go, create a tls.Config with your settings, assign it to a http.Transport, and use that transport in your http.Client.

import (
	"crypto/tls"
	"net/http"
)

func main() {
	tr := &http.Transport{
		TLSClientConfig: &tls.Config{
			InsecureSkipVerify: true,
		},
	}
	client := &http.Client{Transport: tr}
	resp, err := client.Get("https://example.com")
	if err != nil {
		// handle error
	}
	defer resp.Body.Close()
}