cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SSL with curl

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 12 Jan 2011 23:54:34 +0100 (CET)

On Wed, 12 Jan 2011, amit paliwal wrote:

[The questions and thoughts in this mail show a definite need to read up on
how libcurl works and probably how HTTP(S) work as well, so I've had to guess
and assume things that I of course may have guessed wrong about. Please take
this into account below.]

> What will happen when one set of request-response is done as per HTTP1.1 on
> a persisten connection and the Client receives plain raw data on the socket
> (this raw data is not standard HTTP data).

libcurl speaks HTTP. If you ask it to talk HTTP with a server (by specifying a
URL and some othe options) it will send a HTTP request and assume a HTTP
response.

I don't know what "raw data" means here, but I assume you mean that the server
doesn't send any headers at all? If so, that's not syntactically correct HTTP
and I think libcurl is entiteled to drop out or do whatever. I _believe_
however that it will pretend as if there were only non-interesting headers and
it will deliver the "raw data" as response body contents and assume a closed
connection when done.

> Will it call the registered write handler?? or the write handler will be
> called only when we say easy_perform().

Now you really confuse me. If you use the easy interface, OF COURSE it won't
call any callbacks at all until you call curl_easy_perform() as it basically
doesn't do anything until you call that.

This is quite clearly documented and we have probably 30 examples showing it
as well.

> 1) I have SSL enabled on my socket, and expect Open SSL read and write
> function to be called for receiving and sending data on socket, irrespective
> of application layer protocol is HTTP or something else.

(I don't understand this question.)

libcurl will of course not use any OpenSSL (or any other SSL library) calls to
read regular HTTP traffic. libcurl will send all received data to the write
callback, no matter what.

> So if plain raw data comes, will it still come via SSL layer???

(I don't understand this question.)

If you send "raw data" over HTTPS then yes that "raw data" will be sent to the
write callback.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-12