Skip to content

Commit

Permalink
#264: Allow HTTPS connections to terminate in endpoint tests (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
fubarhouse committed Oct 5, 2020
1 parent 07318be commit 48b936b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion service/endpoint/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package endpoint

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

Expand All @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 48b936b

Please sign in to comment.