Skip to content

Commit

Permalink
Fix applying token not working when insecure (#171)
Browse files Browse the repository at this point in the history
* Fix applying token not working when insecure

Signed-off-by: Rupa Lahiri <[email protected]>

* Repeat the check for token within the check for insecure

Signed-off-by: Rupa Lahiri <[email protected]>

---------

Signed-off-by: Rupa Lahiri <[email protected]>
  • Loading branch information
rblcoder authored Apr 1, 2024
1 parent 59a2da7 commit 4501999
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ func getClient(conf *ProviderConf) (*elastic7.Client, error) {
opts = append(opts, elastic7.SetHttpClient(client), elastic7.SetSniff(false))
} else if conf.insecure || conf.cacertFile != "" {
opts = append(opts, elastic7.SetHttpClient(tlsHttpClient(conf, map[string]string{})), elastic7.SetSniff(false))
if conf.token != "" {
opts = append(opts, elastic7.SetHttpClient(tokenHttpClient(conf, map[string]string{})), elastic7.SetSniff(false))
}
} else if conf.token != "" {
opts = append(opts, elastic7.SetHttpClient(tokenHttpClient(conf, map[string]string{})), elastic7.SetSniff(false))
} else {
Expand Down

0 comments on commit 4501999

Please sign in to comment.