Skip to content

Commit

Permalink
chore: skip server certificate verification for http requests in e2e …
Browse files Browse the repository at this point in the history
…tests (argoproj#15733)

* chore: skip verifying server certificate for http requests in e2e tests

Signed-off-by: Chris Fry <christopherfry@google.com>

* chore: skip certificate verification only for remote tests

Signed-off-by: Chris Fry <christopherfry@google.com>

---------

Signed-off-by: Chris Fry <christopherfry@google.com>
  • Loading branch information
ChristopherFry authored and vladfr committed Dec 13, 2023
1 parent 4e09588 commit e068c0e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/e2e/fixture/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fixture

import (
"bytes"
"crypto/tls"
"encoding/json"
"io"
"net/http"
Expand All @@ -27,7 +28,14 @@ func DoHttpRequest(method string, path string, data ...byte) (*http.Response, er
return nil, err
}
req.AddCookie(&http.Cookie{Name: common.AuthCookieName, Value: token})
return http.DefaultClient.Do(req)

httpClient := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: IsRemote()},
},
}

return httpClient.Do(req)
}

// DoHttpJsonRequest executes a http request against the Argo CD API server and unmarshals the response body as JSON
Expand Down

0 comments on commit e068c0e

Please sign in to comment.