cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Https upload with curl

From: <kanakamahesh.anasuri_at_wipro.com>
Date: Fri, 28 Apr 2006 18:28:36 +0530

Hi,


I tried PUT operation as below, my command is not reporting any error
but I don't see upload.txt file on the server.


Upload.txt has the following content,

"Test data for uploading to apache server! Https put operation is
interesting........."


$curl --cacert cacert.pem -H "Accept: */*" -d @/home/upload.txt -v
"https://10.201.114.32:443 <https://10.201.114.32/> "


* About to connect() to 10.201.114.32 port 443

* Trying 10.201.114.32... connected

* Connected to 10.201.114.32 (10.201.114.32) port 443

* successfully set certificate verify locations:

* CAfile: cacert.pem

  CApath: none

* SSLv2, Client hello (1):

SSLv3, TLS handshake, Server hello (2):

SSLv3, TLS handshake, CERT (11):

SSLv3, TLS handshake, Server key exchange (12):

SSLv3, TLS handshake, Server finished (14):

SSLv3, TLS handshake, Client key exchange (16):

SSLv3, TLS change cipher, Client hello (1):

SSLv3, TLS handshake, Finished (20):

SSLv3, TLS change cipher, Client hello (1):

SSLv3, TLS handshake, Finished (20):

SSL connection using DHE-RSA-AES256-SHA

* Server certificate:

* subject: /C=IN/ST=karnataka/O=wipro/OU=telecom/CN=10.201.114.32

* start date: 2006-04-21 05:30:16 GMT

* expire date: 2007-04-21 05:30:16 GMT

* common name: 10.201.114.32 (matched)

* issuer:
/O=wipro/OU=motodc/emailAddress=testuser_at_wipro.com/L=bangalore/ST=karnat
aka/C=IN/CN=10.201.114.32

* SSL certificate verify ok.

> POST / HTTP/1.1

> User-Agent: curl/7.14.0 (i686-pc-linux-gnu) libcurl/7.14.0
OpenSSL/0.9.7f zlib/1.2.2.2 libidn/0.5.15

> Host: 10.201.114.32

> Accept: */*

> Content-Length: 86

> Content-Type: application/x-www-form-urlencoded

>

> Test data for uploading to apache server ! Https put operation is
interesting.........HTTP/1.1 200 OK

< Date: Fri, 28 Apr 2006 12:55:29 GMT

< Server: Apache/2.2.0 (Unix) mod_ssl/2.2.0 OpenSSL/0.9.8a DAV/2

< Last-Modified: Sat, 20 Nov 2004 20:16:24 GMT

< ETag: "1d54e9-2c-4c23b600"

< Accept-Ranges: bytes

< Content-Length: 44

< Content-Type: text/html

Connection #0 to host 10.201.114.32 left intact

* Closing connection #0

* SSLv3, TLS alert, Client hello (1):

<html><body><h1>It works!</h1></body></html>


Thanks

Mahesh





-----Original Message-----
From: curl-users-bounces_at_cool.haxx.se
[mailto:curl-users-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Thursday, April 27, 2006 8:43 PM
To: the curl tool
Subject: RE: Https upload with curl


On Thu, 27 Apr 2006, kanakamahesh.anasuri_at_wipro.com wrote:


> I am trying to use certificates instead of cookies.


They're hardly interchangable, are they really?


> I downloaded file correctly from /apache/htdocs/basic/download.txt
from

> the curl as

>

> $curl --cacert cacert.pem https://10.201.114.32:443/basic/download.txt

> <https://10.201.114.32/basic/download.txt>


Then the CA cert works fine with your server's cert!


> I am trying to put /home/mahesh/upload.txt in to the server using curl
as,

>

> $curl --cacert cacert.pem -F file=@/home/mahesh/upload.txt

> https://10.201.114.32:443/basic/


I asked you before and I can ask you again:


What is "http upload" to you? There is no single http upload method that

automatically does the right thing. HTTP features many ways to provide
data

and you need to use the correct method in the client that the server
expects.


If you want to do a multi-part form-post, then the above example might
be what

you need. It depends on what your server expects.


> P.S: Some of my test results are as follows, which do not perform
actual PUT

> operation.


Of course not, -F does a post exactly as described in the manual.


You did try reading the docs first, right?


--

  Commercial curl and libcurl Technical Support:
http://haxx.se/curl.html

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com
Received on 2006-04-28