I know it's possible to disable InsecureRequestWarning but I need the opposite, I want to either catch it or make the request abort and throw an exception if this warning is present.
I've solved it with warnings.filterwarnings("error"), which turns warnings into errors so they can be caught with try catch.
Is there a way to catch InsecureRequestWarning from python request