Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No proxy support using SQS #789

Closed
jkoehl opened this issue Aug 23, 2017 · 0 comments · Fixed by #790
Closed

No proxy support using SQS #789

jkoehl opened this issue Aug 23, 2017 · 0 comments · Fixed by #790

Comments

@jkoehl
Copy link
Contributor

jkoehl commented Aug 23, 2017

The async HTTP code is not allowing the proxy environment variables to be used by libcurl

It seems to be due to this code in async/http/curl.py

        if request.proxy_host:
            if not request.proxy_port:
                raise ValueError('Request with proxy_host but no proxy_port')
            setopt(_pycurl.PROXY, request.proxy_host)
            setopt(_pycurl.PROXYPORT, request.proxy_port)
            if request.proxy_username:
                setopt(_pycurl.PROXYUSERPWD, '{0}:{1}'.format(
                    request.proxy_username, request.proxy_password or ''))
        else:
            setopt(_pycurl.PROXY, '')
            curl.unsetopt(_pycurl.PROXYUSERPWD)

Notice that if the original request does not specify a proxy_host then it actually sets it to empty in the curl OPTs which makes libcurl NOT read the environment for it either.

And the caller in this case is the SQS transport which does NOT pass any proxy setting in either so when using SQS there doesn't appear to be a way to make Kombu use a proxy for the async HTTP.

(Note: The calls through Boto DO work because Boto reads it from the environment variables by default)

jkoehl added a commit to dotloop/kombu that referenced this issue Aug 23, 2017
…ed http request building unless that is specified by the caller
jkoehl added a commit to dotloop/kombu that referenced this issue Jan 16, 2018
…ed http request building unless that is specified by the caller
@auvipy auvipy added this to the 4.7 milestone May 5, 2020
@auvipy auvipy modified the milestones: 5.1.0, 5.3 Sep 12, 2021
aljets pushed a commit to dotloop/kombu that referenced this issue Jan 12, 2022
…ed http request building unless that is specified by the caller
@auvipy auvipy modified the milestones: 5.3, 5.2.x Jan 13, 2022
auvipy pushed a commit that referenced this issue Jan 14, 2022
* (Issue #789) Don't reset the proxy config in the async curl based http request building unless that is specified by the caller

* Test curl proxy only set when explicitly specified by caller

Co-authored-by: Adam Aljets <aljets@users.noreply.github.com>
keithgg pushed a commit to open-craft/kombu that referenced this issue Aug 11, 2022
…elery#790)

* (Issue celery#789) Don't reset the proxy config in the async curl based http request building unless that is specified by the caller

* Test curl proxy only set when explicitly specified by caller

Co-authored-by: Adam Aljets <aljets@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants