Solved

Downloading a file from SSL url

Posted on 2016-08-25
10
33 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 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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 54

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 54

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

816 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

7 Experts available now in Live!

Get 1:1 Help Now