Download script no longer working

I had a script that would download a zip file, extract and run the contents. Has something changed since the most recent update? Are we running a new version of python? Problem with ssl? Nothing has changed on my server. Any ideas?

Traceback (most recent call last): File “<string>”, line 88, in <module> File “<string>”, line 36, in Download File “C:\Program Files (x86)\COMODO\Comodo ITSM\lib\”, line 154, in urlopen return, data, timeout) File “C:\Program Files (x86)\COMODO\Comodo ITSM\lib\”, line 431, in open response = self._open(req, data) File “C:\Program Files (x86)\COMODO\Comodo ITSM\lib\”, line 449, in _open ‘_open’, req) File “C:\Program Files (x86)\COMODO\Comodo ITSM\lib\”, line 409, in _call_chain result = func(*args) File “C:\Program Files (x86)\COMODO\Comodo ITSM\lib\”, line 1240, in https_open context=self._context) File “C:\Program Files (x86)\COMODO\Comodo ITSM\lib\”, line 1197, in do_open raise URLError(err) urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>

Hello @catcomsys

Is this the script you did try :

If not, kindly please share the exct script name which you have tried.

Thank you

@Aravind_pandi THIS! “ssl._create_default_https_context = ssl._create_unverified_context” that fixed it. Thanks Aravind! Any idea why that line is now needed where it was not before?

Hello @catcomsys

Yes, let me give you the clear explonaion. Downlaoding file through scripthas three stages:

  • Request
  • Verify
  • open
Often you may recieve some error message from the browser when tried to open an URL. The error will be "Security error" that says URL not considered to be safe or information form the site may be harmfull. In our script, we have used MAGIC BROWSER that really suppress all manual works and results as magically. So, as defined 1st we need to request to initiate the handshake, then verify part some browser has strong verification protection by default some may not. So, we are here verifying the content with strong validation using "ssl._create_default_https_context = ssl._create_unverified_context" before open it. Finally, opening the URL reading it, writing on a file.

This the basic steps which are followed to download.

Hope, you are clear now.
Thank you very much