Solved

Downloading a file from SSL url

Posted on 2016-08-25
10
46 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 13

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 13

Expert Comment

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

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 57

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Determining the an SCCM package name from the Package ID
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

705 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