[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 57
  • Last Modified:

Downloading a file from SSL url

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
DevSupport
Asked:
DevSupport
  • 3
  • 2
  • 2
  • +1
4 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
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
 
DevSupportAuthor Commented:
I dont know how to build an exe from the long list of files they have in the curl website.
0
 
DevSupportAuthor Commented:
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!

 
Jeff DarlingDeveloper AnalystCommented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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
 
DevSupportAuthor Commented:
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
 
Jeff DarlingDeveloper AnalystCommented:
sorry.. won't work on files that large.
0
 
Julian HansenCommented:
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
 
Julian HansenCommented:
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

Industry Leaders: 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!

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now