vsphere-automation-sdk-python
vsphere-automation-sdk-python copied to clipboard
Failure to Create Session with vSphere Client Using Self-Signed Certificate
Describe the bug
The create_vsphere_client function encountered an issue when attempting to establish a session with a self-signed server, despite having the session object configured with verify=False. This failure was triggered by an SSLError, specifically an SSLZeroReturnError (error code 6), indicating that the TLS/SSL connection was closed unexpectedly (EOF) at line 997
Reproduction steps
- Create a self-signed server.
- Create a Session object with
session.verify=false. - create a Python script calling the
create_vsphere_clientwith server, username&password, and session. - Run the script.
Expected behavior
The created session will allow us to connect the VMware Vcenter server even if the server is a self-signed certificate.
Additional context
No response
Hi, AFAIK, VC certificates cannot be updated with self signed certificates. Can you tell me what exactly are you trying to do? If you want to verify the SSL cert then why are you setting session.verify=false
Hey @bhagatp10 thank you for the fast response! My VC server is updated with self-signed certificates and it is working fine. I'm trying to retrieve some data using the Client and I want the Client not to verify my certificate when creating the session. As I mentioned before, I tried to send a session object to the Client with the right configuration but from viewing the Client code it ignored this configuration.
Hi, Can you show me the snippet of the code you are using?
Sure.
What python version you are using? What are the urllib3 and openssl version?
python version 3.10.14 urllib3 version 2.2.1
Kindly refer to following troubleshooting section.
https://github.com/vmware/vsphere-automation-sdk-python/wiki/Troubleshooting#certificate-verification-failed-when-making-api-calls