For confirmed bugs, please report:
- Version: 8.12.0 (although this bug likely exists in older versions as well)
- Steps to Reproduce:
- Enroll an Agent in Fleet.
- Setup an HTTP proxy to be used by Agent.
- Configure the proxy settings in the Fleet UI (Settings > Proxies).
- On the host that Agent is installed on, block network access to artifacts.elastic.co:443 so the Agent is forced to download upgrade artifacts, including the
.asc signature file, via the proxy.
- Initiate an upgrade to the Agent from the Fleet UI.
Expected behavior:
- The upgrade completes successfully
Observed behavior:
- The upgrade does not complete successfuly. Agent logs show that the Agent package is downloaded but the download of the
.asc signature file fails.
Relevant implementation details:
This bug is almost certainly being caused because the Verifier code path does not use an HTTP client that's configured with the proxy settings, unlike the Downloader code path, which does.
Downloader code path, showing the use of a custom-configured HTTP client:
|
resp, err := e.client.Do(req.WithContext(ctx)) |
|
if err != nil { |
|
// return path, file already exists and needs to be cleaned up |
|
return fullPath, errors.New(err, "fetching package failed", errors.TypeNetwork, errors.M(errors.MetaKeyURI, sourceURI)) |
|
} |
Verifier code path, showing the use of the default HTTP client:
|
// TODO: receive a http.Client |
|
resp, err := http.DefaultClient.Do(req) |
|
if err != nil { |
|
return nil, errors.New(err, "failed loading public key", errors.TypeNetwork, errors.M(errors.MetaKeyURI, sourceURI)) |
|
} |
For confirmed bugs, please report:
.ascsignature file, via the proxy.Expected behavior:
Observed behavior:
.ascsignature file fails.Relevant implementation details:
This bug is almost certainly being caused because the Verifier code path does not use an HTTP client that's configured with the proxy settings, unlike the Downloader code path, which does.
Downloader code path, showing the use of a custom-configured HTTP client:
elastic-agent/internal/pkg/agent/application/upgrade/artifact/download/http/downloader.go
Lines 193 to 197 in 574aa5d
Verifier code path, showing the use of the default HTTP client:
elastic-agent/internal/pkg/agent/application/upgrade/artifact/download/http/verifier.go
Lines 174 to 178 in 574aa5d