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

Adds support for HTTPS(TLS-in-TLS) proxies and fixes incorrect regex #457

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gabearro
Copy link

Changes:

  • Adds support for HTTPS(TLS-in-TLS) proxies
  • Fixes incorrect regex

…ncorrectly parsing `procotol://username:password@hostname:port/`, it will not work for passwords/usernames that contain `@`, `:`, or whitespace.
@monosans
Copy link
Owner

monosans commented Jan 4, 2025

Hey! I tried to check all default proxy lists with proxy_ssl, and I didn't get any proxies to pass the check. Is there any real point in adding support for https proxies?

@gabearro
Copy link
Author

gabearro commented Jan 5, 2025

@monosans bizarre, when you say "any proxies" do you mean specifically https or even http? If it's the former it's likely that the public https proxies are using self signed certificates that aren't able to be verified by the SSL context. HTTPS proxies are very useful for ensuring that the proxy server can't easily mess with the confidentiality between client -> target host when proxying.

If you modify http.py and set lines 24-26 to:

PROXY_SSL_CONTEXT = ssl.create_default_context(cafile=certifi.where())
PROXY_SSL_CONTEXT.check_hostname = False
PROXY_SSL_CONTEXT.verify_mode = ssl.CERT_NONE # maybe we meet in the middle where we keep certificate verification on but we disable the hostname check?

it will start finding proxies in the public lists. Ideally, you would leave on the certificate verification but disable the hostname verification.

I'm using proxies where the server serves valid certificates so I can find valid ones. Workarounds I can think is retrying proxies that failed the proxy_ssl cert check to be done with verification off?

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.

2 participants