cisco-en-programmability / dnacentersdk

Cisco DNA Center Python SDK
https://dnacentersdk.readthedocs.io/en/latest/
MIT License
70 stars 33 forks source link

DNA_CENTER_VERIFY environment variable is not parsed correctly #56

Closed tomvrugt closed 2 years ago

tomvrugt commented 2 years ago

Prerequisites

Describe the bug When environment variable DNA_CENTER_VERIFY is set to "false" or 0, the DNACenterAPI Connection Object still gets initialized with verify=True.

Expected behavior The DNACenterAPI Connection Object gets initialized with verify=False.

Screenshots

(env) $export DNA_CENTER_BASE_URL=https://***:443
(env) $export DNA_CENTER_USERNAME=admin
(env) $export DNA_CENTER_PASSWORD=***
(env) $export DNA_CENTER_VERIFY=0
(env) $python3
Python 3.9.5 (default, Nov 23 2021, 15:27:38)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dnacentersdk import DNACenterAPI
>>> api = DNACenterAPI()
Traceback (most recent call last):
...
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)

Environment (please complete the following information):

Additional context Add any other context about the problem here.

bvargasre commented 2 years ago

Hi @tomvrugt the problem and the pull request have been reviewed and will be accepted. Thank you for reporting it and providing a solution.