Python API SDK SSL: CERTIFICATE_VERIFY_FAILED Error

I am running into this error trying to connect smartsheet api via python sdk and getting this error on a mac book pro:

smartsheet.exceptions.HttpError: (SSLError(MaxRetryError("HTTPSConnectionPool(host='api.smartsheet.com', port=443): Max retries exceeded with url: /2.0/sheets?pageSize=300&includeAll=False (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))",),), 'SSL handshake error, old CA bundle or old OpenSSL?')

Any help would be great!

Answers

  • Genevieve P.
    Genevieve P. Employee Admin

    Hi @S_M_22

    Since the error is "SSL: Certificate_Verify_Failed", this error is likely due a non up-to-date environment.

    I believe Python on MacOS comes with its own private copy of OpenSSL. This means the trust certificates in the system may no longer be used as defaults by the Python ssl module. To fix that, you may need to install a certifi package in your system.

    I found this thread on StackOverflow which may help you. If it hasn't, please reach out to your IT department as they will need to work out what's happening between Python and your Mac.

    Cheers,

    Genevieve