Failed to verify with shinyapps.io Error message

I am encountering an error when following the steps to setup my account on my local MacBook machine.

This is my error:

Error: Failed to verify with shinyapps (Exception trying to connect to https://api.shinyapps.io - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)).

I am following the documentation for installing Shiny with Python

I use the provided code and run into an error with this code (I fill the required information):

rsconnect add --account <ACCOUNT> --name <NAME> --token <TOKEN> --secret <SECRET>

Looking for any guidance that can be provided. Thank you.

Resolved by installing/running "Applications/Python 3.10/Install Certificates.command" on local machine. Followed the same methods as listed above. Able to authorize computer and continue with deploying app from local machine. :tada:

I'm facing the exact same issue. But working on a linux (ubuntu) machine, so this solution does not work for me. any suggestions welcome. Thanks

OK figured it out myself:
import ssl
paths = ssl.get_default_verify_paths()
showed me the SSL_CERT_FILE points to /usr/local/ssl/cert.pem

but
certifi.where()
showed the pem file was under
~/.local/lib/python3.10/site-packages/certifi/cacert.pem

so in bash
export SSL_CERT_FILE=~/.local/lib/python3.10/site-packages/certifi/cacert.pem

helped and it worked