@@ -187,10 +187,11 @@ def extract_archive(self, from_path: str, to_path: str = None) -> str:
187187 def download_file (self , url : str , file_path : str , chunk_size : int = 1024 ):
188188 """Download a file."""
189189
190- # no check certificate
190+ # For security reasons, this repository code does not provide a function to disable SSL.
191+ # If necessary, please disable SSL verification yourself.
191192 ctx = ssl .create_default_context ()
192- ctx .check_hostname = False
193- ctx .verify_mode = ssl .CERT_NONE
193+ # ctx.check_hostname = False
194+ # ctx.verify_mode = ssl.CERT_NONE
194195
195196 # Define request headers.
196197 headers = {"User-Agent" : self .USER_AGENT }
@@ -230,20 +231,22 @@ def download_url(
230231 return file_path
231232
232233 # Download the file.
234+ # For security reasons, this repository code does not provide a function to disable SSL.
235+ # If necessary, please disable SSL verification yourself.
233236 try :
234237 self .download_file (url , file_path )
235238 except (urllib .error .URLError , IOError ) as e :
236- if url .startswith ("https" ):
237- url = url .replace ("https" , "http" )
238- try :
239- self .download_file (url , file_path )
240- except (urllib .error .URLError , IOError ):
241- # pylint: disable=protected-access
242- ssl ._create_default_https_context = ssl ._create_unverified_context
243- self .download_file (url , file_path )
244- ssl ._create_default_https_context = ssl .create_default_context
245- else :
246- raise e
239+ # if url.startswith("https"):
240+ # url = url.replace("https", "http")
241+ # try:
242+ # self.download_file(url, file_path)
243+ # except (urllib.error.URLError, IOError):
244+ # # pylint: disable=protected-access
245+ # ssl._create_default_https_context = ssl._create_unverified_context
246+ # self.download_file(url, file_path)
247+ # ssl._create_default_https_context = ssl.create_default_context
248+ # else:
249+ raise e
247250
248251 return file_path
249252
0 commit comments