# Elastic Agent Enrollment behind Proxy Server

**URL:** <https://discuss.elastic.co/t/elastic-agent-enrollment-behind-proxy-server/300888>\
**Category:** Beats\
**Tags:** fleet\
**Created:** [March 28, 2022, 7:31pm UTC](https://discuss.elastic.co/t/elastic-agent-enrollment-behind-proxy-server/300888 "2022-03-28T19:31:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alphabet5](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@alphabet5](https://discuss.elastic.co/u/alphabet5)\
**Post date:** [March 28, 2022, 7:31pm UTC](https://discuss.elastic.co/t/elastic-agent-enrollment-behind-proxy-server/300888/1 "2022-03-28T19:31:22Z")

</div>

I am trying to add Elastic Agents to windows hosts. These hosts need to communicate through a proxy (using squid currently).

I've tried adding the registry keys before running the install command, as well as using environment variables.

With proxy being set as

```auto
set HTTP_PROXY="http://proxy.domain.com:3128"
set HTTPS_PROXY="https://proxy.domain.com:3128"

```

I am getting the following error:

```auto
{"log.level":"info","@timestamp":"2022-03-28T14:15:16.562-0500","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":455},"message":"Starting enrollment to URL: https://redacted.fleet.us-east-2.aws.elastic-cloud.com:443/","ecs.version":"1.6.0"}
{"log.level":"warn","@timestamp":"2022-03-28T14:15:16.673-0500","log.logger":"transport","log.origin":{"file.name":"transport/tcp.go","file.line":52},"message":"DNS lookup failure \"\"https\": lookup \"https: no such host","ecs.version":"1.6.0"}
{"log.level":"warn","@timestamp":"2022-03-28T14:15:16.673-0500","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":466},"message":"Remote server is not ready to accept connections, will retry in a moment.","ecs.version":"1.6.0"}

```

With the proxy being set as:

```auto
set HTTP_PROXY="proxy.domain.com:3128"
set HTTPS_PROXY="proxy.domain.com:3128"

```

I am getting the following error:

```auto
{"log.level":"info","@timestamp":"2022-03-28T14:24:52.538-0500","log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":455},"message":"Starting 
enrollment to URL: https://redacted.fleet.us-east-2.aws.elastic-cloud.com:443/","ecs.version":"1.6.0"}
    + CategoryInfo : NotSpecified: ({"log.level":"i...rsion":"1.6.0"}:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName : CMP-NAME

```

I am not seeing any traffic hit the proxy server. It looks like the agent is not trying to communicate through the proxy. Any suggestions?

---

<div class="post-metadata">

**Author:** ![alphabet5](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@alphabet5](https://discuss.elastic.co/u/alphabet5)\
**Post date:** [March 28, 2022, 9:27pm UTC](https://discuss.elastic.co/t/elastic-agent-enrollment-behind-proxy-server/300888/2 "2022-03-28T21:27:38Z")

</div>

When enrolling, you can append the --proxy-url flag.

```auto
--proxy-url="http://proxy.domain.com:3128"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 25, 2022, 11:28pm UTC](https://discuss.elastic.co/t/elastic-agent-enrollment-behind-proxy-server/300888/3 "2022-04-25T23:28:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
