question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessing HTTPS sites through proxy

See original GitHub issue

Why is it that urllib3 doesn’t allow proxy access to HTTPS sites? See poolmanager.py#L416. This limitation seems to be also reflected in the requests library as well.

poolmanager.py#L416

    def connection_from_host(self, host, port=None, scheme='http', pool_kwargs=None):
        if scheme == "https":
            return super(ProxyManager, self).connection_from_host(
                host, port, scheme, pool_kwargs=pool_kwargs)

        return super(ProxyManager, self).connection_from_host(
            self.proxy.host, self.proxy.port, self.proxy.scheme, pool_kwargs=pool_kwargs)

requests/adapters.py#L346

    def request_url(self, request, proxies):
        """Obtain the url to use when making the final request.
        If the message is being sent through a HTTP proxy, the full URL has to
        be used. Otherwise, we should only use the path portion of the URL.
        This should not be called from user code, and is only exposed for use
        when subclassing the
        :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
        :param request: The :class:`PreparedRequest <PreparedRequest>` being sent.
        :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs.
        :rtype: str
        """
        proxy = select_proxy(request.url, proxies)
        scheme = urlparse(request.url).scheme

        is_proxied_http_request = (proxy and scheme != 'https')
        using_socks_proxy = False
        if proxy:
            proxy_scheme = urlparse(proxy).scheme.lower()
            using_socks_proxy = proxy_scheme.startswith('socks')

        url = request.path_url
        if is_proxied_http_request and not using_socks_proxy:
            url = urldefragauth(request.url)

        return url

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
glaukon-aristoncommented, Jan 11, 2019

Is there a roadmap of what needs to be done to support HTTPS over proxy in urllib3? How much work is it? What has already been done so far? Is there a single point in the httplib/http.request that is the root of the problem? Is there a reference implementation you can recommend. I would appreciate any specific details you can provide.

3reactions
OmriBasocommented, Jun 19, 2021

Google ״Omri Baso besocurl״ I wrote a library for that guys

בתאריך שבת, 19 ביוני 2021 ב-17:31 מאת Seth Michael Larson < @.***>:

Closed #1520 https://github.com/urllib3/urllib3/issues/1520.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/urllib3/urllib3/issues/1520#event-4912534082, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMA7VQD4TIW6YSHBOZ5PRZDTTSS53ANCNFSM4GPOFRVQ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTPS connections over proxy servers
I don't think "have HTTPS connections over proxy servers" means the Man-in-the-Middle attack type of proxy server.
Read more >
Can I use an HTTP proxy to connect to an HTTPS server?
An HTTP proxy supports HTTPS. It uses a "CONNECT" command that allows an end-to-end connection between the client and the server and HTTPS...
Read more >
Tunneling SSL Through the Proxy Server
When you are running a Proxy Server (proxy) in the forward direction and a client requests an SSL connection to a secure server...
Read more >
Am I secured if I use http proxy with https website, and how ...
I use this proxy only for https sites. The question is: Am I secured in my case ? Is it possible my proxy...
Read more >
What is an SSL Proxy and How Does it Work
HTTPS proxies use the SSL layer to encrypt any information going between your endpoint and the website, service, or server you want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found