cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Need urgent help for HTTPS

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 23 Nov 2010 23:56:09 -0800

On Mon, Nov 22, 2010 at 05:37:06PM -0500, amit paliwal wrote:
> I am planning to use libcurl for my application. I am developing one
> proprietary protocol which will be communicating with server on top of HTTPS.
> Now I am not getting how can I make use of libcurl.

If your proprietary protocol truly runs "on top of HTTPS", then you'll have
no problem at all. Just do your GET/POST/WHATEVER operations like normal,
and libcurl will handle it fine. If your protocol doesn't actually use HTTPS
but rather a variant that only vaguely looks close enough to HTTPS to get
through some proxy servers, then you might have a problem.

> When I apply CONNECT_ONLY option, it means send() and receive() should be done
> by me, and in that case I will not be able to use HTTP support provided by
> library.
>
> If I allow curl to do things on behalf of me, then by giving write callback, I
> am able to receive the data but then I am not able to send the data to my
> server.

This makes it sound like your protocol falls into the "only superficially
similar to HTTPS" category. If it were truly HTTPS, then you would set up
a POST (or PUT) transfer, send the data to the server from the
READFUNCTION then save the response through the WRITEFUNCTION.

> Please help me in understanding hwo to do it, or can I do it by using libcurl
> or not.

It really depends on the protocol. If it's on top of HTTPS, then libcurl can
do it all. If it's just designed in such a way that CONNECT_ONLY
can get establish the connection, then you should be able to start using
curl_easy_send/recv to bang arbitrary encrypted data out and receive
responses.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-24