Help with using curl to download files from https


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Help with using curl to download files from https
# 1  
Old 02-05-2012
Help with using curl to download files from https

Hi
I'm trying to download an xml file from a https server using curl on a Linux machine with Ubuntu 10.4.2

I am able to connect to the remote server with my username and password but the output is only "Virtual user <username> logged in".
I am expecting to download the xml file.

My output file is created with only the above line. I have tried using verbose and trace but can't see any issues. So I'm assuming I'm missing something in my command or I can't download the file with curl. Trying looking on the net but all the examples suggest I'm doing it right.

This is the command I'm using
curl -O --user username [servername]/file/to/get.xml
(removed credentials and server details for security. )
servername starts https://

This is what I get with verbose
.
.
.
* SSL certificate verify ok.
* Server auth using Basic with user '****'
> GET /file/to/get.xml HTTP/1.1
> Authorization: Basic U0FQUElUb0FVU01BSUxTUlY6MWNQcFdmRGs=
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: [servername]

> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sun, 05 Feb 2012 19:45:52 GMT
< Server: SecureTransport/4.9.2
< Set-Cookie: FDX=784232524263497268494e425975512f45694d626b413d3d; path=/; Secure
< Accept-Ranges: bytes
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Features: CHPWD;RTCK;STCK;ASC;DNDISP
< Content-Length: 42
< Content-Type: text/plain; charset=UTF-8
<
Virtual user [username] logged in.
* Connection #0 to host [servername] left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):

Any help to understand what I'm doing wrong will be much appreciated.
Thank you!!
# 2  
Old 02-06-2012
It prints the file to terminal because you haven't redirected it anywhere else.

Code:
curl ... > filename

You could also try wget, if you have it, which by default saves to the filename given in the URL itself.
# 3  
Old 02-06-2012
Hi Corona,
Thanks for response but same issue.

Redirect simply outputs "Virtual user xxxxx logged in" to the redirect file.

Same behaviour when I use wget i.e message Virtual user .... in save file
# 4  
Old 02-07-2012
Only the maintainer of the server could tell you why it outputs that instead of the data you want.
# 5  
Old 02-07-2012
Ok, I will raise issuse with server maintainer.
Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Curl to download using Linux not working

Good Morning. I'm trying to download a file from a server. I was able to upload to the server successfully but when i download, i see the file name in my server but with some unknow data. The file name i'm trying to download is abcd.zip in binary mode. curl -1 -v --ftp-pasv -o abcd.zip -u... (4 Replies)
Discussion started by: Pavan Kumar19
4 Replies

2. Shell Programming and Scripting

Curl command to download multiple files with a file prefix

I am using the below curl command to download a single file from client server and it is working as expected curl --ftp-ssl -k -u ${USER}:${PASSWD} ftp://${HOST}:${PORT}/path/to/${FILE} --output ${DEST}/${FILE} let say the client has 3 files hellofile.101, hellofile.102, hellofile.103 and I... (3 Replies)
Discussion started by: r@v!7*7@
3 Replies

3. Solaris

Need suggestion:- Failed HTTPS transfer to https://supportfiles.sun.com/curl

Hi Guys, I have recently started reciving below Error message Failed HTTPS transfer to https://supportfiles.sun.com/curl whenever I run /usr/local/bin/sudo /opt/SUNWexplo/bin/explorer -P -q -v from all Servers. Looks like the SSL certificate as Expired. Whenever I type... (4 Replies)
Discussion started by: manalisharmabe
4 Replies

4. UNIX for Dummies Questions & Answers

How to download files matching pattern from FTP using CURL or WGET?

Hi, For an order I requested, the provider has uploaded a tar file in public FTP site which internally has tons of files (compressed) and I need to download files that follows particular pattern which would be few hundreds. Note: The order can't be requested for files that follows the... (7 Replies)
Discussion started by: Amalan
7 Replies

5. Shell Programming and Scripting

Curl ftp ssl download files

Hello all, I have been struggling with this issue on and off for a couple of weeks now and I just got it all working, so I wanted to share my findings in case some other poor soul needs to know how. First some background on what I'm doing. I am uploading files to different directories based on... (0 Replies)
Discussion started by: msjkadams
0 Replies

6. Shell Programming and Scripting

How to download file without curl and wget

Hi I need a Shell script that will download a zip file every second from a http server but i can't use neither curl nor wget. Can anyone will help me go about this task ??? Thanks!! (1 Reply)
Discussion started by: rubber08
1 Replies

7. Shell Programming and Scripting

curl script to download files from Secured HTTPS server?

curl -# -v -d "sendusername=myname&password=mypassword&wheretogo=download.php" -L -o test.zip http://www.ims-dm.com/cgi/securedownload.php?p=HIREFTPM\&prodtype=hire/test.zip * About to connect() to www.ims-dm.com port 80 * Trying 209.61.193.139... connected * Connected to www.ims-dm.com... (1 Reply)
Discussion started by: laknar
1 Replies

8. Shell Programming and Scripting

Download using curl and redirect question_please help

Basically I am needing to Download (using curl) in the background some data from(link here), with stderr redirected to /dev/null, to a file named taxcode I was doing this, curl & http:// name here/download/pls/Title_26.txt 2> /dev/null > taxcode but the results were not what I was after. ... (1 Reply)
Discussion started by: santod
1 Replies

9. Shell Programming and Scripting

Shell Script for Upload/download files using cURL

hi please help me out here, i want to use curl command in shell script to test web pages, what i have is an opening page, when i click on a button on opening page, the next page comes up and then i have to upload a file n then click another button to submit and then comes the output page,... (2 Replies)
Discussion started by: Olivia
2 Replies

10. UNIX for Dummies Questions & Answers

cURL Active FTP Download

Hello, I know this is probably a very silly question for most but how to do I force curl to do active FTP downloads? Thank you Dallas (2 Replies)
Discussion started by: Dallasbr
2 Replies
Login or Register to Ask a Question