cURL / Mailing Lists / curl-users / Single Mail

curl-users

Post File to HTTPS via cURL at command line

From: Amy Petri <Apetri_at_geneoswealth.com>
Date: Tue, 14 Jun 2005 13:29:50 -0600

For months I have been trying to figure out a command line cURL method of posting a file to a secure site. The file must be POSTed, and a user name and password are required to login. Can anyone tell me what my potential problem could be with the below command? Any help is greatly appreciated.

curl -v -k -# -u username:password \
   https://www.somesite.com{/incoming/} \
   -F File=@/tmp/xmlfile.nrq \
   -A "Mozilla/4.0"

The output...

* About to connect() to www.somesite.com port 443
* Connected to www.somesite.com (209.223.39.11) port 443
* error setting certificate verify locations, continuing anyway:
* CAfile: /usr/share/curl/curl-ca-bundle.crt
  CApath: none
* SSL connection using DES-CBC3-SHA
* Server certificate:
* subject: /C=US/ST=North Carolina/L=Charlotte/O=NASD/OU=CIS/OU=Terms of use at www.verisign.com/rpa (c)00/CN=www.somesite.com
* start date: 2004-06-24 00:00:00 GMT
* expire date: 2005-06-24 23:59:59 GMT
* common name: www.somesite.com (matched)
* issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
* SSL certificate verify result: 19, continuing anyway.
* Server auth using Basic with user 'username'
> POST /incoming/ HTTP/1.1
Authorization: Basic QkQxMjA4OTQ6c3VsbHk4NDch
User-Agent: curl/7.11.0 (x86_64-suse-linux) libcurl/7.11.0 OpenSSL/0.9.7d ipv6 zlib/1.2.1
Host: www.somesite.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 918
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------badfdda5543d

< HTTP/1.1 200 OK
< Date: Tue, 14 Jun 2005 19:23:36 GMT
< Server: Apache/1.3.26 (Unix) mod_ssl/2.8.10 OpenSSL/0.9.6g SecureTransport/4.1.1
< Set-Cookie: FDX=zALbQKHJPD64e7X+OAeQwg==; path=/
< Accept-Ranges: bytes
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Features: CHPWD;RTCK;STCK;ASC
< Transfer-Encoding: chunked
< Content-Type: text/plain; charset=UTF-8
Virtual user username logged in.
* Connection #0 left intact
* Closing connection #0

Thanks again for any help / insight.
Amy
Received on 2005-06-14