Hi,
I would like to connect to vCenter using the http port 8080. Here's my sample code, but it's returning an error. I believe it's because of the "http://" part of the address. If I leave that off, pysphere assumes it's ssl and that doesn't work either. Is there a way to tell pysphere to use https or not?
Thanks
with protocol as part of the vCenter address ....
from pysphere import VIServer
server = VIServer()
Traceback (most recent call last):
File "test_pysphere.py", line 3, in <module>
File "build/bdist.macosx-10.7-intel/egg/pysphere/vi_server.py", line 85, in connect
File "build/bdist.macosx-10.7-intel/egg/pysphere/resources/VimService_services.py", line 2175, in RetrieveServiceContent
File "build/bdist.macosx-10.7-intel/egg/pysphere/ZSI/client.py", line 544, in Receive
File "build/bdist.macosx-10.7-intel/egg/pysphere/ZSI/client.py", line 429, in ReceiveSOAP
TypeError: Response is "text/html", not "text/xml"
without protocol hitting 8080 ...
from pysphere import VIServer
server = VIServer()
Traceback (most recent call last):
File "test_pysphere.py", line 3, in <module>
File "build/bdist.macosx-10.7-intel/egg/pysphere/vi_server.py", line 85, in connect
File "build/bdist.macosx-10.7-intel/egg/pysphere/resources/VimService_services.py", line 2173, in RetrieveServiceContent
File "build/bdist.macosx-10.7-intel/egg/pysphere/ZSI/client.py", line 296, in Send
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1144, in connect
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 344, in wrap_socket
ciphers=ciphers)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 121, in __init__
self.do_handshake()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 283, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [Errno 1] _ssl.c:499: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol