cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: problem with curl and websphere(apache with mod-ibm-ssl)

From: <cissp_at_sach.mailshell.com>
Date: Thu, 20 Dec 2001 10:00:35 -0800

Daniel,

I have built a standalone executable which does a simple post to the servlet residing on the websphere app server.

Here is the code:-

 curl = curl_easy_init();
  if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "https://e302190.nw.nos.boeing.com/servlet/com.boeing.wss.common.authentication.servlet.AuthenticationServlet");
  
   /* send all data to this function */
  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);

  /* we pass our 'chunk' struct to the callback function */
  curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk);

//create a parameter string to pass parameters to
//the servlet. (userid=<userid>"&passwd=<passwd>
   strcpy(parambuffer, "userid=");
   strcat(parambuffer, "user1");
   strcat(parambuffer, "&passwd=");
   strcat(parambuffer, "pass1");

    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, parambuffer);
    res = curl_easy_perform(curl);

    /* always cleanup */
    curl_easy_cleanup(curl);

________________END________________________

This code works well as a standalone executable. Now i use the same code and build it as part of a shared object. I seem to get an error while trying to execute the same code in an shared object.

I was not able to compile the libcurl code with the ssl option enabled even though i had openssl libraries on my machine. So i installed a compiled curl-ssl package. Will this cause any of the above problems ?

The utility "curl" works fine. I am able to call https URL's and get back results from them.

I am not doing curl_global_init. I read it in the documentation that curl_easy_init calls curl_global_init internally.

The shared object is built around a oblix netpoint single sign-on infrastructure. So the oblix Access server executable calls the shared object.

--Sach.

From Daniel Stenberg <daniel_at_haxx.se>:

> On Wed, 19 Dec 2001
> cissp.at.sach.mailshell.com_at_cissp.at.sach.mailshell.com wrote:
>
> > I have a standalone executable which calls a servlet on a websphere
> > application server using https. The executable works fine.
>
> "standalone executable" as in 'curl' the command line tool?
>
> > But I want to use this code in a shared library on sun solaris 2.8,
> g++
> > 3.0.2, openssl 9.6b, curl 7.9.2.
>
> "this code" ? You mean the code you have in the "standalone executable"
> ?
>
> > This shared library is able to call a servlet using http. When i try
> to use
> > the https protocol and call the same servlet on ibm websphere app
> server
> > which runs apache(1.3.12) and mod_ibm_ssl, i run into ssl handshake
> > problems.
>
> So, what's the difference between the "standalone executable" and the
> "shared
> library" ?
>
> > the exact error that i get in the web server logs is as follows: -
> >
> > [Wed Dec 19 14:37:20 2001] [error] mod_ibm_ssl: SSL Handshake Failed,
> > Socket has been closed.
>
> Does it work when you use curl the tool to do this?
>
> If so, do you curl_global_init() properly?
>
> If so, did you need -3 or -2 to the command line tool for this to work?
>
> If not, we might need to see some actual code on how you do this to
> perhaps
> spot why this doesn't work...
>
> --
> Daniel Stenberg -- curl groks URLs --
> http://rd.mailshell.com/curl.haxx.se/
>
>
>
> ---------- Your subscription is protected by Mailshell ----------
> To unsubscribe or change delivery options:
> http://www.mailshell.com/control.html?a=bcfgr6pofppjlkhq3ee9iimorifor0c
>
> Wouldn't you rather have sacgad.com as your personal domain?
> http://rd.mailshell.com/ad465
> Earn up to $3 for each of your friends who signs up with Mailshell!
> http://rd.mailshell.com/sp5
>

_______________________________________________________
The FREE service that prevents junk email http://www.mailshell.com
Received on 2001-12-20