Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Support HTTPS_PROXY env var for outbound proxy config #4198

Closed
Gribou opened this issue Nov 18, 2018 · 9 comments
Closed

Support HTTPS_PROXY env var for outbound proxy config #4198

Gribou opened this issue Nov 18, 2018 · 9 comments
Assignees
Labels
z-p2 (Deprecated Label)

Comments

@Gribou
Copy link

Gribou commented Nov 18, 2018

Description

When using homeserver behind a corporate proxy, synapse python don't use proxy global variable.
So when put request to matrix.org are send there's a timeout connection.


INFO - httppush.process-16 - Error sending request to POST https://matrix.org/_matrix/push/v1/notify: TimeoutError
2018-11-18 09:26:55,016 - synapse.push.httppusher - 339 - WARNING - httppush.process-16 - Failed to push event $15424483970iGDrt:synapse.mycompagny.fr to @john.doe:synapse.mycompagny.fr/im.vector.app.ios.voip.prod/aQ/0cQk1HFOF2GkU/8Z9k66ZgImmNU4gVFU431tYsLc=
Traceback (most recent call last):
File "/root/.synapse/lib/python2.7/site-packages/synapse/push/httppusher.py", line 335, in dispatch_push
resp = yield self.http_client.post_json_get_json(self.url, notification_dict)
TimeoutError: User timeout caused connection failure.

.


@Gribou Gribou changed the title Using a coporate Proxy Using a corporate Proxy Nov 18, 2018
@richvdh
Copy link
Member

richvdh commented Nov 19, 2018

proxy global variable.

what proxy global variable?

@Gribou
Copy link
Author

Gribou commented Nov 19, 2018

it's the unix global variable (environment variable) https_proxy use by the system.

@richvdh richvdh changed the title Using a corporate Proxy Support HTTPS_PROXY env var for outbound proxy config Nov 19, 2018
@Gribou
Copy link
Author

Gribou commented Nov 19, 2018

Thx

@Gribou
Copy link
Author

Gribou commented Nov 20, 2018

May be the best way is to use httplib2shim, but i don't know how to do that.

@neilisfragile neilisfragile added z-p2 (Deprecated Label) enhancement labels Nov 20, 2018
@agentpurple
Copy link

agentpurple commented Feb 14, 2019

same issue here. I installed a test server on a vm where I don't have a public IP so I used squid to proxy synapse.
everything works fine exept the push notifications. The log shows exactly the mentioned entry.
Having a proxy option would be great for 1.0!

@michaelkaye
Copy link
Contributor

Notes for anyone implementing this: While twisted provides /some/ proxy support as part of ProxyAgent, that does not support HTTP CONNECT based proxies, which is the normal method required for connecting to https endpoints

@richvdh richvdh self-assigned this Oct 30, 2019
richvdh added a commit that referenced this issue Nov 1, 2019
The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy.

The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`.

The proxy will then be used for
 * push
 * url previews
 * phone-home stats
 * recaptcha validation
 * CAS auth validation

It will *not* be used for:
 * Application Services
 * Identity servers
 * Outbound federation
 * In worker configurations, connections from workers to masters

Fixes #4198.
@richvdh
Copy link
Member

richvdh commented Nov 1, 2019

fixed by #6239

@richvdh richvdh closed this as completed Nov 4, 2019
anoadragon453 pushed a commit that referenced this issue Jan 24, 2020
The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy.

The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`.

The proxy will then be used for
 * push
 * url previews
 * phone-home stats
 * recaptcha validation
 * CAS auth validation

It will *not* be used for:
 * Application Services
 * Identity servers
 * Outbound federation
 * In worker configurations, connections from workers to masters

Fixes #4198.
@abliss
Copy link

abliss commented Aug 21, 2020

Hi, I see that this was marked closed, but the linked commit specifically disavows using the proxy for outbound federation. Is there a reason for that? How would I achieve federation in a controlled network environment where all outbound traffic must be proxied?

@clokep
Copy link
Member

clokep commented Aug 24, 2020

@abliss Probably worth filing a new issue (if there isn't one already).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

7 participants