MinGW Setup – Solving the “cannot open URL” error

I encountered a download issue with MinGW setup on Windows 10.
I saw that other users were having this error but there were no working solution on the Internet.
As I managed to solve this issue, I’m sharing the solution below.

Symptom

Trying to install MinGW using mingw-get-setup.exe, I had the following errors:

mingw-get: *** ERROR *** http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.tar.xz?download:cannot open URL
mingw-get: *** ERROR *** Get package: http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.tar.xz?download: download failed
mingw-get: *** ERROR *** http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-gui.tar.xz?download:cannot open URL
mingw-get: *** ERROR *** Get package: http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-gui.tar.xz?download: download failed
mingw-get: *** ERROR *** http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-lic.tar.xz?download:cannot open URL
mingw-get: *** ERROR *** Get package: http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-lic.tar.xz?download: download failed
mingw-get: *** ERROR *** http://prdownloads.sourceforge.net/mingw/mingw-get-setup-0.6.2-mingw32-beta-20131004-1-dll.tar.xz?download:cannot open URL
mingw-get: *** ERROR *** Get package: http://prdownloads.sourceforge.net/mingw/mingw-get-setup-0.6.2-mingw32-beta-20131004-1-dll.tar.xz?download: download failed
mingw-get: *** ERROR *** http://prdownloads.sourceforge.net/mingw/mingw-get-setup-0.6.2-mingw32-beta-20131004-1-xml.tar.xz?download:cannot open URL
mingw-get: *** ERROR *** Get package: http://prdownloads.sourceforge.net/mingw/mingw-get-setup-0.6.2-mingw32-beta-20131004-1-xml.tar.xz?download: download failed
mingw-get: *** INFO *** setup: unpacking mingw-get-0.6.2-mingw32-beta-20131004-1-bin.tar.xz
mingw-get: *** ERROR *** unpack: required archive file is not available
mingw-get: *** ERROR *** unpack: aborted due to previous download failure
mingw-get: *** INFO *** setup: unpacking mingw-get-0.6.2-mingw32-beta-20131004-1-gui.tar.xz
mingw-get: *** ERROR *** unpack: required archive file is not available
mingw-get: *** ERROR *** unpack: aborted due to previous download failure
mingw-get: *** INFO *** setup: unpacking mingw-get-0.6.2-mingw32-beta-20131004-1-lic.tar.xz
mingw-get: *** ERROR *** unpack: required archive file is not available
mingw-get: *** ERROR *** unpack: aborted due to previous download failure
mingw-get: *** INFO *** setup: unpacking mingw-get-setup-0.6.2-mingw32-beta-20131004-1-dll.tar.xz
mingw-get: *** ERROR *** unpack: required archive file is not available
mingw-get: *** ERROR *** unpack: aborted due to previous download failure
mingw-get: *** INFO *** setup: unpacking mingw-get-setup-0.6.2-mingw32-beta-20131004-1-xml.tar.xz
mingw-get: *** ERROR *** unpack: required archive file is not available
mingw-get: *** ERROR *** unpack: aborted due to previous download failure
mingw-get: *** ERROR *** setup: unable to continue

Analysis

I used Wireshark and Procmon in order to investigate this issue.
I could see that mingw-get-setup.exe was first connecting to http://prdownloads.sourceforge.net/mingw/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.tar.xz?download, it was receiving a HTTP Code 301 (Moved Permanently, indicating a Location). It was then connecting to downloads.sourceforge.net/project/mingw/installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.tar.xz?download and it was receiving a HTTP Code 302 (Found) and then, it was starting over.

Looking at the wireshark capture, I could see that the http response code 302 was giving a Location pointing to a https URL: https://netcologne.dl.sourceforge.net/project/mingw/installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.tar.xz

Using a browser, it was possible to access this https URL and to download the file. However, mingw-get-setup.exe was not even trying to connect to this URL.

Solution

As I saw using Procmon that mingw-get-setup.exe was using wininet.dll and winhttp.dll, I focused on Internet Explorer settings. I compared the settings between a computer that was able to download the MinGW package and my computer and I finally found the security setting that was causing the issue:”Warn if changing between secure and not secure mode” (“Avertir en cas de changement entre mode sécurisé et non sécurisé” in French).

I disabled this setting by unchecking the option “Warn if changing between secure and not secure mode” and then mingw-get-setup.exe could download all packages.

MinGW Setup – Solving the “cannot open URL” error

Leave a Reply

Your email address will not be published. Required fields are marked *