Requests provides the facility to verify an SSL certificate for HTTPS requests. We can use the
verify argument to check whether the host's SSL certificate is verified or not.
Let us consider a website which has got no SSL certificate. We shall send a GET request with the argument
verify to it.
The syntax to send the request is as follows:
requests.get('no ssl certificate site', verify=True)
As the website doesn't have an SSL certificate, it will result an error similar to the following:
requests.exceptions.ConnectionError: ('Connection aborted.', error(111, 'Connection refused'))
Let us verify the SSL certificate for a website which is certified. Consider the following example:
>>> requests.get('https://python.org', ...