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

Weird behaviour with https and proxy authentication #6578

Open
sigscanner opened this issue Nov 19, 2023 · 4 comments
Open

Weird behaviour with https and proxy authentication #6578

sigscanner opened this issue Nov 19, 2023 · 4 comments

Comments

@sigscanner
Copy link

requests.get is getting weird with some combinations of dictionary keys and proxy authentication.

Expected Result

print(requests.get('https://google.com', proxies={"https" : 'https://user:pass@ip:port'}))

Output:
<Response [200]>

Actual Result

Doesn't run? (Maybe timeout)
But it somehow fixes itself with these changes

print(requests.get('https://google.com', proxies={"http" : 'http://user:pass@ip:port'}))

Output:
<Response [200]>

Reproduction Steps

import requests

print(requests.get('https://google.com', proxies={"https" : 'https://user:pass@ip:port'}))

print(requests.get('https://google.com', proxies={"http" : 'http://user:pass@ip:port'}))

System Information

$ python -m requests.help
{
  "chardet": {
    "version": null
  },
  "charset_normalizer": {
    "version": "2.0.12"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "3.4"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.10.11"
  },
  "platform": {
    "release": "10",
    "system": "Windows"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.27.1"
  },
  "system_ssl": {
    "version": "1010114f"
  },
  "urllib3": {
    "version": "1.26.9"
  },
  "using_charset_normalizer": true,
  "using_pyopenssl": false
}
$ python --version
Python 3.10.11
@sigscanner
Copy link
Author

proxies im using are https capable

@sigscanner
Copy link
Author

misclick

@visions4k
Copy link

its most likely that your proxies only support http protocol, it should work the way you have it, so its probably proxy issues.

@sigscanner
Copy link
Author

proxies im using are https capable

its most likely that your proxies only support http protocol, it should work the way you have it, so its probably proxy issues.

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

2 participants