cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP

From: <RBramante_at_on.com>
Date: Wed, 11 Jun 2003 13:00:03 -0400

Hi Misha,

Take a look at the manpage for curl_easy_setopt, specifically the
CURLOPT_SSL_VERIFYPEER option.

                                                                                                                                                      
                      Vassilevich_Misha_at_emc.com
                      Sent by: To: curl-library_at_lists.sourceforge.net
                      curl-library-admin_at_lists.sour cc:
                      ceforge.net Subject: HTTP
                                                                                                                                                      
                                                                                                                                                      
                      06/11/2003 12:35 PM
                      Please respond to
                      curl-library
                                                                                                                                                      
                                                                                                                                                      

Hi all

I wrote Java clent program to talk to our server via https . I am creating
HTTP header and BODY of the request myself of and simply enable SSL socket
and send it as the string of the following format :

POST /servlets/CelerraManager HTTP/1.1
Host: XXX.XXX.XXX.XXX:443
Content-Type: text/xml
Content-Length: 395
EMCXMPUser: nasadmin
EMCXMPAction: mtr

<?xml version="1.0" encoding="UTF-8"?><Packet xmlns="
http://www.emc.com/schemas/celerra/xsd_v2.3" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.emc.com/schemas/celerra/xsd_v2.3
C:\PROJECTS\CMGR_XML\XSD\xhmp_request.xsd"><User un="nasadmin"
pw="nasadmin" close="true" /><Request handle="12346"><ControlStation>
<Config/></ControlStation></Request> </Packet>

Java test program works fine no problem . Now i am trying to achive the
same thing using CURL library .Looking throgh some examples and docs i got
the following hybrid for above request :

curl = curl_easy_init();
struct curl_slist *headers=NULL;

headers = curl_slist_append(headers, "Content-Type: text/xml"); //customer
header text/xml
headers = curl_slist_append(headers, "EMCXMPUser: nasadmin");// define
myself not in curl !!!
headers = curl_slist_append(headers, "EMCXMPAction: mtr"); // define
myself not in curl !!!

curl_easy_setopt(curl, CURLOPT_POSTFIELDS,"/servlets/CelerraManager");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS,total.c_str() );
/// Where total body of http request
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_URL,"https://xxx.xxx.xxx");
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,&curl_write_hook);
curl_easy_setopt(curl,CURLOPT_FILE,&outbuf);
int test = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);

I am getting error message number 60 all the time . Does anybody can spot
what i am doing wrong . Will realy appriciate any response and corrections
to my hybrid :)))))

Misha .

-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Received on 2003-06-11