Skip to content

[py] Use ssl_proxy descriptor when initializing Proxy from raw dict - #18237

Merged
cgoldberg merged 2 commits into
SeleniumHQ:trunkfrom
saiyam-jain-dev:fix-proxy-raw-sslproxy
Oct 27, 2026
Merged

cgoldberg merged 2 commits into
SeleniumHQ:trunkfrom
saiyam-jain-dev:fix-proxy-raw-sslproxy

Conversation

@saiyam-jain-dev

@saiyam-jain-dev saiyam-jain-dev commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

When initializing a Proxy instance from a dictionary, all proxy properties (http_proxy, o_proxy, proxy_autoconfig_url, auto_detect, socks_proxy, etc.) use their corresponding descriptor on Proxy, except sslProxy which directly assigned self.sslProxy = raw["sslProxy"].

Setting self.sslProxy directly bypassed the _ProxyTypeDescriptor, causing two issues when sslProxy is supplied without httpProxy:

  1. proxy.proxy_type remained ProxyType.UNSPECIFIED instead of transitioning to ProxyType.MANUAL.
  2. As a result, o_capabilities() emitted {'proxyType': 'unspecified', ...} and o_bidi_dict() omitted sslProxy completely.
  3. Incompatible proxy type verification (_verify_proxy_type_compatibility) was skipped.

This PR changes self.sslProxy = raw["sslProxy"] to self.ssl_proxy = raw["sslProxy"] and adds tests to verify proxy.proxy_type is correctly set to MANUAL and compatibility is enforced.

Motivation and Context

Fixes unexpected UNSPECIFIED proxy type and missing proxy configuration when creating a Proxy from a dictionary containing sslProxy.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@CLAassistant

CLAassistant commented Oct 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@selenium-ci selenium-ci added the C-py Python Bindings label Oct 25, 2026
Setting self.sslProxy directly in Proxy.__init__ bypassed the ssl_proxy
descriptor, preventing the proxy type compatibility check from running
and failing to set proxyType to MANUAL when sslProxy was provided alone.
Using self.ssl_proxy ensures the descriptor sets proxyType properly and
validates compatibility.
@cgoldberg
cgoldberg self-requested a review October 25, 2026 18:08
@cgoldberg cgoldberg self-assigned this Oct 25, 2026

@cgoldberg cgoldberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍, thanks

@cgoldberg
cgoldberg merged commit 10141c5 into SeleniumHQ:trunk Oct 27, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-py Python Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants