NETWAYS/check_vmware_nsxt

#SSL_CERTIFICATE_VERIFY_FAILED

Closed this issue · 7 comments

Hi, there is any possibility to get trough this error?

_[CRITICAL] HTTPSConnectionPool(host='XX.XX.XX.XX', port=443): Max retries exceeded with url: /api/v1/capacity/usage (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (ssl.c:1056)')))

I've tried so many workaroud but with no success.

Could be Related to NSX-T destionatio the use only selfsigned Cert?

Hi @CerealKller ,
yes, this seems to be related to selfsigned certs.
Without changing anything to the plugin, you would have to add the CA which signed the certificate to the system certificate store of the machine executing the checks.

Hi @RincewindsHat

Thank you for your hint! I've downloaded the full chain from NSX-T page and stored in CA store of Python.
Work like a charm now.

Thanks,

I will leave this issue open as a note to one time implement something like --insecure or --ca-path|--certificate-path

that would be a nice features for multiple instances.

$ diff check_vmware_nsxt.py check_vmware_nsxt2.py

41a42,43
> import urllib3
> urllib3.disable_warnings()

117c119
<             response = requests.request(method, request_url, auth=HTTPBasicAuth(self.username, self.password))
---
>             response = requests.request(method, request_url, auth=HTTPBasicAuth(self.username, self.password), verify=False)

@uvu9Ba Thanks for the reminder, could you test #3 for me? I don't have the environment at hand.

Closing this with #3