Skip to content

Verifier does not honor proxy settings #4237

@ycombinator

Description

@ycombinator

For confirmed bugs, please report:

  • Version: 8.12.0 (although this bug likely exists in older versions as well)
  • Steps to Reproduce:
  1. Enroll an Agent in Fleet.
  2. Setup an HTTP proxy to be used by Agent.
  3. Configure the proxy settings in the Fleet UI (Settings > Proxies).
  4. 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.
  5. 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))
}

Metadata

Metadata

Assignees

Labels

Team:Elastic-AgentLabel for the Agent teambugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions