commit 8cc7eb12ea0d2cd26be310c5b02e32ac6a47b5a9 from: Nicolas Dandrimont date: Wed Jan 24 16:16:18 2024 UTC loader: add option to skip certificate verification This hooks into the right urllib3 and requests settings for both the smart and dumb loader. commit - 8848bd310b2841ff7f8c0bde78f1339b09d57c63 commit + 8cc7eb12ea0d2cd26be310c5b02e32ac6a47b5a9 blob - d4fa48814ac273c160bd930be094e137fd2b0a4b blob + 5217edd9bc9894e37dd088138285c1925d5fe5be --- swh/loader/git/loader.py +++ swh/loader/git/loader.py @@ -182,6 +182,7 @@ class GitLoader(BaseGitLoader): temp_file_cutoff: int = 100 * 1024 * 1024, connect_timeout: float = 120, read_timeout: float = 60, + verify_certs: bool = True, urllib3_extra_kwargs: Dict[str, Any] = {}, requests_extra_kwargs: Dict[str, Any] = {}, **kwargs: Any, @@ -216,6 +217,10 @@ class GitLoader(BaseGitLoader): self.requests_extra_kwargs = requests_extra_kwargs self.requests_extra_kwargs["timeout"] = (connect_timeout, read_timeout) + if not verify_certs: + self.urllib3_extra_kwargs["cert_reqs"] = "CERT_NONE" + self.requests_extra_kwargs["verify"] = False + def fetch_pack_from_origin( self, origin_url: str,