# Windows Agent error "server gave HTTP response to HTTPS client"

**URL:** <https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989>\
**Category:** Vault\
**Tags:** vault\
**Created:** [November 13, 2023, 4:46am UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989 "2023-11-13T04:46:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jedi](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jedi](https://discuss.hashicorp.com/u/jedi)\
**Post date:** [November 13, 2023, 4:46am UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989/1 "2023-11-13T04:46:43Z")

</div>

pretty simple setup:

Vault Server:  
listener “tcp” {  
address = “[vault-server.com:8200](http://vault-server.com:8200)”  
tls\_disable = 1  
}

Vault Agent:  
listener “tcp” {  
address = “[vault-server.com:8100](http://vault-server.com:8100)”  
tls\_disable = true  
tls\_disable\_client\_certs = true  
}

when starting the Windows Agent Service, I got the following error:  
] agent.auth.handler: error authenticating: error=“Put "[https://vault-server.com:8200/v1/auth/approle/login\](https://vault-server.com:8200/v1/auth/approle/login%5C)”: http: server gave HTTP response to HTTPS client"

any advises would be very much appreciated.

---

<div class="post-metadata">

**Author:** ![jonathanfrappier](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jonathanfrappier/32/28004_2.png) [@jonathanfrappier](https://discuss.hashicorp.com/u/jonathanfrappier)\
**Post date:** [November 13, 2023, 4:23pm UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989/2 "2023-11-13T16:23:31Z")

</div>

Hi @jedi

If I am reading this correctly, you have set the Vault Server to have TLS disabled but looks like maybe your Vault agent config has the address set to https?

---

<div class="post-metadata">

**Author:** ![jedi](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jedi](https://discuss.hashicorp.com/u/jedi)\
**Post date:** [November 14, 2023, 2:29am UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989/3 "2023-11-14T02:29:31Z")

</div>

thanks Jon, as you see from my post, the agent listener is tcp with tls\_disable = true

---

<div class="post-metadata">

**Author:** ![jonathanfrappier](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jonathanfrappier/32/28004_2.png) [@jonathanfrappier](https://discuss.hashicorp.com/u/jonathanfrappier)\
**Post date:** [November 14, 2023, 12:31pm UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989/4 "2023-11-14T12:31:01Z")

</div>

Hi Jason,

I do see that the listener has TLS disabled. Apologies for not being more clear, I would expect somewhere in the agent config there should be a `vault` stanza that the agent uses to connect to the Vault server similar to

```auto
vault {
  address = "https://vault-server.com:8200"
}

```

An example configuration is in this tutorial, in the configure vault agent section (step 5) [Vault Agent Windows service | Vault | HashiCorp Developer](https://developer.hashicorp.com/vault/tutorials/vault-agent/agent-windows-service#configure-vault-agent)

---

<div class="post-metadata">

**Author:** ![jedi](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jedi](https://discuss.hashicorp.com/u/jedi)\
**Post date:** [November 15, 2023, 1:32am UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989/5 "2023-11-15T01:32:22Z")

</div>

thanks Joh for the folowing up.  
agent connecting server via $env:VAULT\_ADDR=“[http://vault-server:8200](http://vault-server:8200)”.

step 5 in the link shows same config with mine:

listener “tcp” {  
address = “127.0.0.1:8100”  
tls\_disable = true  
}

---

<div class="post-metadata">

**Author:** ![jonathanfrappier](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jonathanfrappier/32/28004_2.png) [@jonathanfrappier](https://discuss.hashicorp.com/u/jonathanfrappier)\
**Post date:** [November 15, 2023, 1:44am UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989/6 "2023-11-15T01:44:21Z")

</div>

> [@jedi](#):
>
> error=“Put "[https](https://vault-server.com:8200/v1/auth/approle/login%5C)

The actual error you are getting though has http **S** :// in the Vault address?

---

<div class="post-metadata">

**Author:** ![jedi](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@jedi](https://discuss.hashicorp.com/u/jedi)\
**Post date:** [November 15, 2023, 3:47am UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989/7 "2023-11-15T03:47:05Z")

</div>

found the issue, creating windows service with wrong -address (should be http)

New-Service xxxx -address=“[https://vault-server8200](https://vault-server8200)”’

thanks so much Jon. your feedback triggers me look back this cli.

---

<div class="post-metadata">

**Author:** ![jonathanfrappier](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jonathanfrappier/32/28004_2.png) [@jonathanfrappier](https://discuss.hashicorp.com/u/jonathanfrappier)\
**Post date:** [November 15, 2023, 1:23pm UTC](https://discuss.hashicorp.com/t/windows-agent-error-server-gave-http-response-to-https-client/59989/8 "2023-11-15T13:23:32Z")

</div>

@jedi - great to hear and happy to help!
