OpenAttack
OpenAttack copied to clipboard
fix zip_downloader
This update aims to solve the certificate verification problem in data downloading.
Currently, when automatically downloading data using DataManager, there raises an URL error:
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>
This is caused by
https://github.com/thunlp/OpenAttack/blob/4df712e0a5aebc03daa9b1ef353da4b7ea0a1b23/OpenAttack/utils/zip_downloader.py#L31
When opening an https, urllib.request.urlopen automatically verifies the SSL certificate and then cause the error. This can be solved with help of the ssl library.