Closed maethu closed 5 years ago
ftw.linkchecker uses requests library. The solution would be to add the path to the hosts certificates like:
requests.get('https://github.com', verify='/path/to/certfile')
But since we only want to do head requests I need to look further into it.
@maethu is there a server where we could install and test if requests.head('https://whatever.com', verify='/path/to/certfile')
is working, where we have some data for the linkchecker and the cerfiles lie around?
From https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings:
InsecureRequestWarning This happens when a request is made to an HTTPS URL without certificate verification enabled. Follow the certificate verification guide to resolve this warning.
ftw.linkchecker
disables certificate verification and urllib3
(which is used or bundled by requests
) complains about it:
Why is certificate verification disabled in the first place?
Removing verify=False
should remove the InsecureRequestWarning
.
We decided to not change this because some customers use proxies and internally self signed certificates. If we changed the line most of the links would throw an error even though they are signed.
Fair enough. But then you could disable the InsecureRequestWarning
instead:
Making unverified HTTPS requests is strongly discouraged, however, if you understand the risks and wish to disable these warnings, you can use _disablewarnings():
import urllib3 urllib3.disable_warnings()
Source https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
I don't mind the warnings. Atleast it runs/works. Don't want to go back to code not working because of SSI cirtification or whatever reason.
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarning)
Please check if we can do something about this.