# Https\_proxy not working

**URL:** <https://community.n8n.io/t/https-proxy-not-working/27820>\
**Category:** Questions\
**Tags:** telegram\
**Created:** [July 5, 2023, 6:26pm UTC](https://community.n8n.io/t/https-proxy-not-working/27820 "2023-07-05T18:26:34Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![browse](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@browse](https://community.n8n.io/u/browse)\
**Post date:** [July 5, 2023, 6:26pm UTC](https://community.n8n.io/t/https-proxy-not-working/27820/1 "2023-07-05T18:26:34Z")

</div>

## Describe the problem/error/question

@Jon Hi, this is a follow-up of [Telegram ERROR: Bad request - please check your parameters - #9 by Jon](http://community.n8n.io/t/telegram-error-bad-request-please-check-your-parameters/27484/9).

I’ve setup an https proxy, and curl works fine with it.

Ths problem is https\_proxy not working for me. It still returen errors.

## What is the error message (if any)?

In frontend:

```auto
Bad Request

```

Backend log:

```auto
error | NodeApiError: Request failed with status code 400 "{ file: 'ErrorReporterProxy.js', function: 'report' }"
error | Error: Request failed with status code 400 "{ file: 'ErrorReporterProxy.js', function: 'report' }"
error | NodeApiError: Request failed with status code 400 "{ file: 'ErrorReporterProxy.js', function: 'report' }"
error | Error: Request failed with status code 400 "{ file: 'ErrorReporterProxy.js', function: 'report' }"

```

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 6, 2023, 10:56am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/4 "2023-07-06T10:56:14Z")

</div>

Hey @browse,

Does the proxy log show any errors? Is your proxy also configured to use a self signed certificate for the connection or is it a proper cert? Looking at the previous post this is something that I know works so I suspect there is going to be another configuration issue somewhere.

If you are using a self signed certificate that will likely be the issue as the Node instance for n8n won’t trust the certificate and it would fail.

---

<div class="post-metadata">

**Author:** ![browse](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@browse](https://community.n8n.io/u/browse)\
**Post date:** [July 6, 2023, 3:21pm UTC](https://community.n8n.io/t/https-proxy-not-working/27820/5 "2023-07-06T15:21:01Z")

</div>

@Jon The proxy log shows it has been routed and no error. I does use self-signed certificate, but I’ve add the CA to the n8n docker image, and add `NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt` env.

Is there any method to make n8n show more detailed error?  
Or, how can I patch n8n’s axios to fix the proxy bug?

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 6, 2023, 3:23pm UTC](https://community.n8n.io/t/https-proxy-not-working/27820/6 "2023-07-06T15:23:45Z")

</div>

Hey @browse,

If the request is being routed then it would suggest that it is a legitimate 400 error and the data you are sending to Telegram is incorrect somewhere. You could try making the same request using the HTTP request node to see what that returns with the full response option on.

---

<div class="post-metadata">

**Author:** ![browse](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@browse](https://community.n8n.io/u/browse)\
**Post date:** [July 7, 2023, 2:17am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/7 "2023-07-07T02:17:38Z")

</div>

@Jon This is what I got from `GET https://google.com`:

```auto
{"status":"rejected","reason":{"message":"503 - \"\"","name":"Error","stack":"Error: 503 - \"\"\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at RedirectableRequest.handleResponse (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:238:9)\n at RedirectableRequest.emit (node:events:525:35)\n at RedirectableRequest.emit (node:domain:489:12)\n at RedirectableRequest._processResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:356:10)\n at ClientRequest.RedirectableRequest._onNativeResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:62:10)\n at Object.onceWrapper (node:events:628:26)\n at ClientRequest.emit (node:events:513:28)\n at ClientRequest.emit (node:domain:489:12)"}}

```

Here is the stack:

```auto
NodeApiError: Service unavailable - try again later or consider setting this node to retry automatically (in the node settings)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:1253:27)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:652:28)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:596:53

```

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 7, 2023, 6:49am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/8 "2023-07-07T06:49:51Z")

</div>

Hey @browse,

That looks like an HTTP 503 error, I would expect Google to work as it works for me. What does your proxy log show for that connection?

---

<div class="post-metadata">

**Author:** ![browse](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@browse](https://community.n8n.io/u/browse)\
**Post date:** [July 7, 2023, 9:51am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/9 "2023-07-07T09:51:09Z")

</div>

@Jon I use V2Ray as proxy. The log just show the traffic has been accepted and been routed and no more detailed. And curl works find with that proxy.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 7, 2023, 10:54am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/10 "2023-07-07T10:54:21Z")

</div>

Hey @browse,

Can you try calling `https://webhook.site/886c674d-2801-445d-8d3d-cb77b5dae389` to see if that works?

---

<div class="post-metadata">

**Author:** ![browse](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@browse](https://community.n8n.io/u/browse)\
**Post date:** [July 10, 2023, 2:37am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/11 "2023-07-10T02:37:57Z")

</div>

@Jon With the same proxy, curl works fine, n8n didn’t work.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 10, 2023, 6:51am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/12 "2023-07-10T06:51:56Z")

</div>

Hey @browse,

What did n8n report back as the error? Looking at the page I can see the curl user-agent but I can’t see one for n8n which makes me wonder if maybe the connection is not going through and there is still some odd proxy setting that Axios is not able to work with.

I can confirm that n8n is still working as expected when using Squid as a proxy.

---

<div class="post-metadata">

**Author:** ![browse](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@browse](https://community.n8n.io/u/browse)\
**Post date:** [July 11, 2023, 2:20am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/13 "2023-07-11T02:20:45Z")

</div>

@Jon When I request webhook.site, the error is:

```auto
{"status":"rejected","reason":{"message":"503 - \"\"","name":"Error","stack":"Error: 503 - \"\"\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at RedirectableRequest.handleResponse (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:238:9)\n at RedirectableRequest.emit (node:events:525:35)\n at RedirectableRequest.emit (node:domain:489:12)\n at RedirectableRequest._processResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:356:10)\n at ClientRequest.RedirectableRequest._onNativeResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:62:10)\n at Object.onceWrapper (node:events:628:26)\n at ClientRequest.emit (node:events:513:28)\n at ClientRequest.emit (node:domain:489:12)"}}

```

And I also tried in [https://app.interactsh.com](https://app.interactsh.com), the error is different:

```auto
{"status":"rejected","reason":{"message":"400 - \"Client sent an HTTP request to an HTTPS server.\\n\"","name":"Error","stack":"Error: 400 - \"Client sent an HTTP request to an HTTPS server.\\n\"\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at RedirectableRequest.handleResponse (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:238:9)\n at RedirectableRequest.emit (node:events:525:35)\n at RedirectableRequest.emit (node:domain:489:12)\n at RedirectableRequest._processResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:356:10)\n at ClientRequest.RedirectableRequest._onNativeResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:62:10)\n at Object.onceWrapper (node:events:628:26)\n at ClientRequest.emit (node:events:513:28)\n at ClientRequest.emit (node:domain:489:12)"}}

```

It looks like the server didn’t receive request. It’s so interesting that curl works well and n8n just don’t work. No idea how to debug it.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 11, 2023, 8:18am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/14 "2023-07-11T08:18:37Z")

</div>

Hey @browse,

I suspect it could be more oddness with Axios and the way your proxy is configured, Although that second error seems to think an http request was sent almost like the https\_proxy isn’t using https. Does your proxy log the url it is getting?

I don’t know V2Ray but I suspect there is going to be some checkbox somewhere that is doing something odd.

---

<div class="post-metadata">

**Author:** ![browse](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@browse](https://community.n8n.io/u/browse)\
**Post date:** [July 14, 2023, 9:09am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/15 "2023-07-14T09:09:40Z")

</div>

@Jon It looks like that my proxy only accept `connect` method, which doesn’t work with axios.

I’ve looked into squid these days, and I’m a little confused about it’s configuration.  
Could you please provide me a working config?  
Thanks very much.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [July 14, 2023, 9:15am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/16 "2023-07-14T09:15:53Z")

</div>

Hey @browse,

I can provide you with the steps that I use for testing but it should be considered as just a test environment and for something that you plan to use in production it would be worth investigating a safer configuration.

This assumes you have your SSL certificate under ~/squidcert.pem, If you plan to use a self signed certificate there is more risk involved.

> **squid.conf**
>
> ```auto
> http_port 3128
> https_port 3129 cert=/etc/squid/proxy.pem
> 
> dns_v4_first on
> 
> acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
> acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
> acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
> acl localnet src fc00::/7 # RFC 4193 local private network range
> acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
> 
> acl CONNECT method CONNECT
> 
> http_access allow localnet
> http_access allow localhost
> 
> ```

> **Docker Compose**
>
> ```auto
> version: '3.8'
> services:
> squid:
> image: sysdignathan/secure-squid:latest
> ports:
> - "3128:3128"
> - "3129:3129"
> volumes:
> - ~/squid.conf:/etc/squid/squid.conf
> - ~/squidcert.pem:/etc/squid/proxy.pem
> - ~/squidlogs:/var/log/squid
> 
> ```

> **n8n Env**
>
> ```auto
> http_proxy=http://squid:3128
> http_proxy=https://squid:3129
> 
> ```

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [October 12, 2023, 9:16am UTC](https://community.n8n.io/t/https-proxy-not-working/27820/17 "2023-10-12T09:16:32Z")

</div>

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