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

windows proxy settings taken only partly #5095

Open
elschman opened this issue May 16, 2019 · 0 comments
Open

windows proxy settings taken only partly #5095

elschman opened this issue May 16, 2019 · 0 comments

Comments

@elschman
Copy link

do run python 2.7/3.7 on a windows 7 host.
This host is AD managed. As part of the group policy the internet settings are set to automatically proxy configuration with an wpad.dat file at the AD server.
The configuration works. cos IE and Chrome can reach external and internal hosts. Some of the internal are excluded from proxy via no proxy rules inside the dat file.

But on python with requests im not able to reach the internal addresses which are excluded via the proxy file rules. Python always tries to get the data from the proxy.

The only solution was an extra environmental variable NO_PROXY with the ips not to be reached via the proxy.

These excluded IPs are common IPs and not private ! (90.0.0.0/8) is part of the wpad.dat exclusion

Expected Result

either no proxy or all proxy settings should taken into account.

Actual Result

every requests traffic is placed on the proxy
urllib3 works as expected

Reproduction Steps

import requests
import urllib3
http1 = urllib3.PoolManager()
r1 = http.request('GET', 'http://90.0.11.253:43001/')
r1.status 

r2 = requests.get('http://90.0.11.253:43001/')
r2.status_code

r1==r2 must be true but isnt

System Information

$ python -m requests.help
C:\Users\iwetzel\AppData\Local\Programs\Python\Python37-32>python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.8"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.7.1"
  },
  "platform": {
    "release": "7",
    "system": "Windows"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.21.0"
  },
  "system_ssl": {
    "version": "1010009f"
  },
  "urllib3": {
    "version": "1.24.3"
  },
  "using_pyopenssl": false
}

This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).

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

No branches or pull requests

1 participant