vmware / pyvmomi

VMware vSphere API Python Bindings
Apache License 2.0
2.22k stars 766 forks source link

Python code gives error HTTPProxyConnection.call() missing 2 required positional arguments: 'port' and 'timeout' #1090

Open prashant1diwase opened 3 months ago

prashant1diwase commented 3 months ago

Describe the bug

When we tried to connect with the below details, it started giving the below error with pyvmomi 8.0.3.0.1

Error

HTTPProxyConnection.call() missing 2 required positional arguments: 'port' and 'timeout'

Reproduction steps

When we tried to connect with the below details, it started giving the below error with pyvmomi 8.0.3.0.1

Code

    server = "146.89.140.53"
    httpsProxy ='http://146.72.882.22:3128'
    proxy = urlparse(httpsProxy)

    smart_stub = SmartStubAdapter(
        host=server,
        httpProxyHost=proxy.hostname,
        httpProxyPort=proxy.port,
        disableSslCertValidation=True,
    )

Expected behavior

It should be able to connect

Additional context

Analysis

However, when we checked further there was a change in implementation for pyvmomi 8.0.3.0.1 compared with pyvmomi 8.0.2.0.1. When we applied the fix given in https://github.com/vmware/pyvmomi/issues/1085, by changing committed files [connect.py, Security.py, SoapAdapter.py] (https://github.com/vmware/pyvmomi/commit/9a8956f7b4a91b491e63454b3eb3c59d4abb8a31) it gave different error -

Error

[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1006)')