From 48b936b37e78aaf5f2c3645b1d7300dbe7a37dce Mon Sep 17 00:00:00 2001 From: Karl Hepworth Date: Mon, 5 Oct 2020 22:03:00 +1100 Subject: [PATCH] #264: Allow HTTPS connections to terminate in endpoint tests (#265) --- service/endpoint/endpoint.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/service/endpoint/endpoint.go b/service/endpoint/endpoint.go index bf2fd7d0..607eccf6 100644 --- a/service/endpoint/endpoint.go +++ b/service/endpoint/endpoint.go @@ -3,6 +3,7 @@ package endpoint import ( + "crypto/tls" "net/http" ) @@ -13,6 +14,11 @@ import ( // This is to provided to the user through the up and status commands. func Validate(url string) bool { + tr := &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + } + client := &http.Client{Transport: tr} + // Create a web request req, err := http.NewRequest("GET", url, nil) if err != nil { @@ -21,7 +27,7 @@ func Validate(url string) bool { } // Submit a web request - resp, err := http.DefaultClient.Do(req) + resp, err := client.Do(req) if err != nil { // Test failed. return false