diff --git a/pyVmomi/SoapAdapter.py b/pyVmomi/SoapAdapter.py index cbe67f0..49daa03 100644 --- a/pyVmomi/SoapAdapter.py +++ b/pyVmomi/SoapAdapter.py @@ -1036,7 +1036,7 @@ class SSLTunnelConnection(object): tunnel.request('CONNECT', self.proxyPath) resp = tunnel.getresponse() if resp.status != 200: - raise httplib.HTTPException("{0} {1}".format(resp.status, resp.reason)) + raise http_client.HTTPException("{0} {1}".format(resp.status, resp.reason)) retval = http_client.HTTPSConnection(path) retval.sock = _SocketWrapper(tunnel.sock, keyfile=key_file, certfile=cert_file) diff --git a/tests/fixtures/ssl_tunnel_http_failure.yaml b/tests/fixtures/ssl_tunnel_http_failure.yaml new file mode 100644 index 0000000..ed7d739 --- /dev/null +++ b/tests/fixtures/ssl_tunnel_http_failure.yaml @@ -0,0 +1,15 @@ +interactions: +- request: + body: null + headers: {} + method: CONNECT + uri: http://vcsavcsa:80 + response: + body: {string: !!python/unicode '