Interview Prep/Python for DevOps/Data formats, HTTP & REST APIs

What does `verify=False` do, and what should you do instead?

IntermediateConceptData formats, HTTP & REST APIs
Answer

It disables TLS certificate verification, so any man-in-the-middle can impersonate the server and read your credentials. It also spams InsecureRequestWarning. The real fix for internal or proxied endpoints is to trust the right CA: verify="/etc/ssl/certs/corp-ca.pem" or REQUESTS_CA_BUNDLE=/path/ca.pem (requests uses certifi's bundle, not the OS store, unless told otherwise; the truststore package can make it use the OS store).

All Python for DevOps questions Roadmap: Python for automation

More on Data formats, HTTP & REST APIs