Skip to content

Commit

Permalink
Disable usage of X509 certs if Token is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Apr 7, 2021
1 parent ce1756d commit 21731d5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions utils/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,14 @@ func readToken(r string) string {

// HttpClient is HTTP client for urlfetch server
func HttpClient() *http.Client {
// get X509 certs
// certs, err := tlsCerts()
certs, err := tlsManager.GetCerts()
if err != nil {
log.Fatal("ERROR ", err.Error())
var certs []tls.Certificate
var err error
if Token == "" { // if there is no token back auth we fall back to x509
// get X509 certs
certs, err = tlsManager.GetCerts()
if err != nil {
log.Fatal("ERROR ", err.Error())
}
}
timeout := time.Duration(TIMEOUT) * time.Second
if len(certs) == 0 {
Expand Down

0 comments on commit 21731d5

Please sign in to comment.