I have been having this error when trying to make web requests to various hosts. After debugging a bit I have found the solution is updating the requests[security] through p
Run
sudo python3 -m pip install "requests[security]"
or
sudo python -m pip install "requests[security]"
to fix this issue.