cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTPS POST problem

From: Jens Fiedler <jens.fiedler_at_fokus.fraunhofer.de>
Date: Tue, 28 Sep 2004 17:21:30 +0200

I switched from the multi interface to the easy interface and there i get
the error: Failed to curl_easy_perform(): unsupported protocol

Here is the code snipplet that produces the error, url is a https:// url:
<code>
        c = curl_easy_setopt ( eh, CURLOPT_URL, url );
        if (c) { printf ("Could not set URL.\n"); return; }

        c=curl_easy_setopt( eh, CURLOPT_POSTFIELDS, body );
        if (c!=0) { printf ("Failed to CURLOP_POSTFIELDS\n"); }

        /* set the size of the postfields data */
        c=curl_easy_setopt( eh, CURLOPT_POSTFIELDSIZE, strlen(body) );
        if (c!=0) { printf ("Failed to CURLOP_POSTFIELDSIZE\n"); }

        /* pass our list of custom made headers */
        c=curl_easy_setopt( eh, CURLOPT_HTTPHEADER, headers );
        if (c!=0) { printf ("Failed to CURLOP_HTTPHEADER\n"); }

        /* set the call back function for reply data/headers */
        c=curl_easy_setopt( eh, CURLOPT_WRITEFUNCTION, cb_incoming_data );
        if (c!=0) { printf ("Failed to CURLOP_WRITEFUNCTION\n"); }
        c=curl_easy_setopt( eh, CURLOPT_WRITEDATA, (void *)4 );
        if (c!=0) { printf ("Failed to CURLOP_WRITEDATA\n"); }
        c=curl_easy_setopt( eh, CURLOPT_HEADERFUNCTION, cb_incoming_data );
        if (c!=0) { printf ("Failed to CURLOP_HEADERFUNCTION\n"); }
        c=curl_easy_setopt( eh, CURLOPT_WRITEHEADER, (void *)8 );
        if (c!=0) { printf ("Failed to CURLOP_WRITEHEADER\n"); }

        c=curl_easy_setopt( eh, CURLOPT_VERBOSE, (long) 1 );
        if (c!=0) { printf ("Failed to CURLOP_VERBOSE\n"); }

        c=curl_easy_setopt( eh, CURLOPT_SSL_VERIFYPEER, false);
        if (c!=0) { printf ("Failed to CURLOP_VERIFYPEER\n"); }

        c=curl_easy_setopt( eh, CURLOPT_SSL_VERIFYHOST, false);
        if (c!=0) { printf ("Failed to CURLOP_VERIFYHOST\n"); }

        c=curl_easy_perform( eh );
        if (c!=0) { printf ("Failed to curl_easy_perform(): %s\n", curl_easy_strerror(c) ); }
</code>

curl-config --feature says:
SSL
IPv6
libz

Did I do anything wrong when compiling curl ? Why could HTTPS be unsupported else ?

Cheers, -JF

> Hi,
>
> I try to send a file over https to a server.
> Using a http:// url works fine. I can see the request going out.
> and the lib says "connecting ... etc."
> But when I replace it with an https:// url nothing goes,
> even with CURLOPT_VERBOSE there is no output at all.
> I'm a noob for ssl anf https, so probably I forgot something.
>
> There are also no error conditions in any curl functions.
> I do not know how what to try next.
>
> Any help welcome.
>
> -JF
Received on 2004-09-28