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.

To change this settings, open the “control panel” and go to “Internet Options”. Go to the “Advanced” tab and you will find the option “Warn if changing between secure and not secure mode” in the “Security” section.

MinGW Setup – Solving the “cannot open URL” error

3 thoughts on “MinGW Setup – Solving the “cannot open URL” error

  • 3 October 2018 at 9 h 31 min
    Permalink

    Good investigation, well done ! You helped me and I thank you for that.

    Reply
  • 7 July 2020 at 2 h 10 min
    Permalink

    I’m having the same problem, could you expand in your solution explanation? I don’t understand how setup the Internet Explorer in Windows 10 can solve an Internet connection issue with MinGW Installation Manager. Thanks in advance.

    Reply
    • 1 September 2020 at 21 h 28 min
      Permalink

      Hello, I added how to find and change this settings.
      It works because MinGW is using the Internet Explorer DLL to access the Internet (and so the Internet settings) and I think that MinGW gets a warning when switching from secure and not secure mode and it doesn’t handle it correctly.

      Reply

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.