This package patches requests
and urllib3
at runtime to authenticate with kerberos proxy (spnego)
- set the environment variables to NON-kerberos proxy and use
pip install ...
set https_proxy=http://<NONkerberosproxy>:8080 set http_proxy=http://<NONkerberosproxy>:8080 pip install kerberos-proxy-auth
- download this package manually as well as all its dependancies.
- run this command
pip install path/to/kerberos-proxy-auth-main.zip path/to/dependancy1.zip path/to/dependancy2.zip [...]
After installation
- set the environment variables
set https_proxy=http://<kerberosproxy>:8080 set http_proxy=http://<kerberosproxy>:8080
- start python and use
requests
,urllib3
orpip
even from behind the kerberos proxy without any further action.import requests r = requests.get('https://example.org') print(r.status_code) # expected: 200 r = requests.head('https://example.org') print(r.status_code) # expected: 200 r = requests.request('GET', 'https://example.org') print(r.status_code) # expected : 200 import urllib3, os http = urllib3.poolmanager.proxy_from_url(os.getenv('https_proxy')) r = http.request('GET', 'https://example.org') print(r.status) # expected : 200
- test, feedback, contribute improvements
- rework to support other environments (currently only: windows/system)