Solved

Downloading a file from SSL url

Posted on 2016-08-25
10
24 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
  • 3
  • 2
  • 2
  • +1
10 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 125 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Is there a powershell or batch way to download a file from https url?
0
 
LVL 12

Assisted Solution

by:Jeff Darling
Jeff Darling earned 125 total points
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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
Comment Utility
sorry.. won't work on files that large.
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 250 total points
Comment Utility
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 51

Accepted Solution

by:
Julian Hansen earned 250 total points
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now