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

Default to doing DNS resolution through a proxy server if present. #276

Merged
merged 1 commit into from
Jul 14, 2014

Conversation

micolous
Copy link
Contributor

  • Resolve an issue where proxy information by default was not resolving DNS through a proxy server (unlike the socks library), so users getting proxy information from an environment variable (HTTP_PROXY/HTTPS_PROXY) with no external DNS could not connect to hosts with DNS names. There isn't any way to set proxy_rdns from proxy_info_from_environment or proxy_info_from_url, so this gives a sensible default, making httplib2 work the same way as most web browsers.
  • Resolve a potential issue where if the proxy server was a different address family to the destination host and there was functional DNS, may not work. For example, using a IPv4-only proxy server to connect to an IPv6-only host via an IPv4-only internal network. This code (and thus issue) only appears to exist in the Python 2 version of the code.
  • Improved documentation of the ProxyInfo class.
  • Because the default behaviour is now to resolve DNS names through a proxy server, this has the added benefit of preventing DNS leaking issues to an untrusted network when using a proxy over SSH or Tor.

- Resolve an issue where proxy information by default was not resolving DNS
  through a proxy server (unlike the `socks` library), so users getting
  proxy information from an environment variable (HTTP_PROXY/HTTPS_PROXY)
  with no external DNS could not connect to hosts with DNS names.

- Resolve a potential issue where if the proxy server was a different
  address family to the destination host and there was functional DNS, may
  not work.  For example, using a IPv4-only proxy server to connect to an
  IPv6-only host via an IPv4-only internal network.

- Improved documentation of the ProxyInfo class.
jcgregorio added a commit that referenced this pull request Jul 14, 2014
Default to doing DNS resolution through a proxy server if present.
@jcgregorio jcgregorio merged commit df1cca4 into jcgregorio:master Jul 14, 2014
@cliffano
Copy link

cliffano commented Oct 7, 2014

Verified that the proxy_rdns sensible default change works for solving dns resolution behind a proxy server and without a local nameserver.
@jcgregorio Any chance of releasing 0.10?

A bit of context: I'm using httplib2 via Ansible's uri module. The default proxy_rdns=None in httplib2 v0.9 results in sock.connect() to raise gaierror which in turn raises ServerNotFoundError, which Ansible uri module passes as a failure with "Unable to resolve host name given." error message.

Edit: typo and clarity.

jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Feb 4, 2016
0.9.2:

Changes not documented.

0.9.1:

Fixes in this release:

jcgregorio/httplib2#296

    There was a problem with headers when a binary string is passed (like
    b'Authorization').

jcgregorio/httplib2#276

    Default to doing DNS resolution through a proxy server if present.
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Feb 11, 2016
0.9.2:

Changes not documented.

0.9.1:

Fixes in this release:

jcgregorio/httplib2#296

    There was a problem with headers when a binary string is passed (like
    b'Authorization').

jcgregorio/httplib2#276

    Default to doing DNS resolution through a proxy server if present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants