waldirio / rvtools_python

Application to be executed on Linux and collect all information from vCenter
10 stars 8 forks source link

Connecting to Vcenter with rvtools #47

Open freeAppProd opened 1 year ago

freeAppProd commented 1 year ago

Hello,

I am using python 3.6 and trying to use rvtools, iam facing this error, i think is a certification issue in vcenter but not sur.

Thank you for your helps

File "/opt/rh/rh-python36/root/usr/lib64/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 104] Connection reset by peer

File conf: cat ~/.rvtools.conf vcenter=ip.exemple.com username=usertest password=passtest directory=/home/test

waldirio commented 5 months ago

Hello @freeAppProd

Thank you for the heads up. I just released a new version, please, let me know if you are able to update via pip and try again. Let me know if the error persists.

In the code, I'm forcing the unverified context

    ssl_context = ssl._create_unverified_context()
...
    service_instance = connect.SmartConnect(host=server, user=username, \
         pwd=password, port=443, sslContext=ssl_context)

And I also tried using the FQDN and IP address as well, both worked.

Thank you again and sorry for the delay. Waldirio

waldirio commented 5 months ago

Hello @freeAppProd

Reading the issue once again

 ConnectionResetError: [Errno 104] Connection reset by peer

Does the machine that you are trying to connect to the vCenter, by any chance hve some rules/firewall? This could also be the root cause.

Thank you! Waldirio