[go: nahoru, domu]

Skip to content

Commit

Permalink
HTTPProxyConnection and SSLTunnelConnection documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ddraganov committed May 14, 2024
1 parent 44d7b9f commit 0c8b1ac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pyVmomi/SoapAdapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,13 +1099,14 @@ def __init__(self, proxyPath, customHeaders=None):
self.customHeaders = customHeaders if customHeaders else {}

# Connects to an HTTP proxy server and initiates a tunnel to the destination
# specified by self.proxyPath. If successful, a new HTTPSConnection is returned.
# specified by self.proxyPath.
#
# @param addr Address in the form of host:port
# @param port If no port number is passed,
# the port is extracted from the addr string
# @param timeout Connection timeout in seconds
# @param context SSL Context describing the various SSL options
# @param context SSL Context with the desired SSL options
# @return HTTPSConnection to the destination
def __call__(self, addr, port, timeout, context):
conn = HTTPSConnection(host=addr, port=port,
timeout=timeout, context=context)
Expand All @@ -1117,15 +1118,16 @@ def __call__(self, addr, port, timeout, context):
# issue a CONNECT command to start an SSL tunnel.
class SSLTunnelConnection(HTTPProxyConnection):
# Connects to a proxy server and initiates a tunnel to the destination
# specified by self.proxyPath. If successful, a new HTTPSConnection is returned.
# specified by self.proxyPath.
# For Python Version < 2.7.9. cert_reqs=CERT_OPTIONAL to verify
# server certificate
#
# @param addr Address in the form of host:port
# @param port If no port number is passed,
# the port is extracted from the addr string
# @param timeout Connection timeout in seconds
# @param context SSL Context describing the various SSL options
# @param context SSL Context with the desired SSL options
# @return HTTPSConnection to the destination
def __call__(self, addr, port=None, timeout=None, context=None):
tunnelConn = HTTPConnection(host=addr, port=port, timeout=timeout)
tunnelConn.request('CONNECT', self.proxyPath)
Expand Down

0 comments on commit 0c8b1ac

Please sign in to comment.