Solved

Downloading a file from SSL url

Posted on 2016-08-25
10
44 Views
Last Modified: 2016-10-14
I use curl to download files from URLs. For example I download the file abcd.zip from http://example.com/sites/abcd.zip using cURL.exe

curl.exe -O "http://example.com/sites/abcd.zip"

when I download files from SSL urls it gives me an error:

curl: (1) Protocol https not supported or disabled in libcurl.

I am attaching the curl utility which I am using.

Please let me know if there is a way to download SSL urls using curl utility or if there is a better way to download SSL files from urls similar to this way.

Thanks
curl.exe.changetoexe.txt
0
Comment
Question by:DevSupport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
10 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 125 total points
ID: 41770897
I am not willing to download an EXE file that I don't know where it came from.  cURL has supported SSL/TLS for a long time.  However, you also need some additional files for it to work.  You may also need to download a set of 'root certificates'.

But you can download versions of cURL that do Not include SSL support.  Make sure that you have a version that includes it.  https://curl.haxx.se/download.html
0
 

Author Comment

by:DevSupport
ID: 41770903
I dont know how to build an exe from the long list of files they have in the curl website.
0
 

Author Comment

by:DevSupport
ID: 41770907
Is there a powershell or batch way to download a file from https url?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Assisted Solution

by:Jeff Darling
Jeff Darling earned 125 total points
ID: 41770916
How about a VBScript?

The proxy lines are only needed if behind a proxy.

Dim strArg
Dim objArgs

' Get argument from the command line
Set objArgs = WScript.Arguments
URL = objArgs(0)
saveTo = objArgs(1)

Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
'objXMLHTTP.setProxy 2, "http=proxy.mydomain.com:8080", ""
objXMLHTTP.open "GET", URL, False
objXMLHTTP.setOption 2, 13056
'objXMLHTTP.setProxyCredentials "username","password"
objXMLHTTP.send()

If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")

objADOStream.Open
objADOStream.Type = 1 'adTypeBinary

objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0    'Set the stream position to the start

Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(saveTo) Then objFSO.DeleteFile saveTo
Set objFSO = Nothing

objADOStream.SaveToFile saveTo
objADOStream.Close
Set objADOStream = Nothing
End if

Set objXMLHTTP = Nothing

Open in new window


This takes 2 parameters url and filename

sample:

cscript Getfile.vbs http://www.jeffld.com/ConsoleApp.zip ConsoleApp.zip

Open in new window

0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41770940
If you are on Windows, there are binary / pre-compiled versions you can download.  Look in the Windows section near the bottom of the page.
0
 

Author Comment

by:DevSupport
ID: 41770984
I tried Jeff's suggestion and I get this error:

c:\test\Getfile.vbs(22, 1) msxml6.dll: Not enough storage is available to comple
te this operation.

I have more than 300GB free space and I am trying to download a file which is 4 GB.

Thanks
0
 
LVL 12

Expert Comment

by:Jeff Darling
ID: 41771034
sorry.. won't work on files that large.
0
 
LVL 56

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
ID: 41771273
Is there any specific reason you are using cURL for this - can you not look at other tools like wGet

If you look on the cUrl download you see this
Screen Shot cURL download page
0
 
LVL 56

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 41771285
With reference to the above both contain an EXE, however I found the first one (7MB) very annoying and chose the smaller one instead.

This works but it is compiled with OpenSSL so unless you use the -k switch (Verify Peer off) you might get an error. If you don't want to use the -k switch you can follow the instructions here (https://curl.haxx.se/docs/sslcerts.html) on how to setup your Windows system.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question