cURL / Mailing Lists / curl-library / Single Mail

curl-library

Question about cacert.pem on Windows with MinGW

From: Thomas Mayer <thomas_at_residuum.org>
Date: Mon, 13 May 2013 22:13:25 +0200

Hello,

I am developping a library for Puredata to make RESTful web requests.

Everything is working quite well with libcurl, but I have a problem
using SSL secured requests in Windows.

I am cross compiling libcurl on Linux using MXE, but I get SSL errors
when setting the path to the cacert.pem from the library.

This is what I have tried:
I am setting the cacert path using

curl_easy_setopt(curl_handle, CURLOPT_SSLCERT, common->cert_path);

where common->cert_path is char[2048] (not a pointer, just for testing)
and is C:/Program Files (x86)/pd/extra/purest_json/cacert.pem

cacert.pem is the download from http://curl.haxx.se/docs/caextract.html,
and I have set read/write access to everyone, I have already tried
replacing slashes with backslashes.

Here are the configure scripts from MXE that I have tried and the error
codes:

gnutls:
-------
./configure \
        --host='$(TARGET)' \
        --build="`config.guess`" \
        --disable-shared \
        --prefix='$(PREFIX)/$(TARGET)' \
        --with-gnutls \
        --without-ssl \
        --with-libidn \
        --enable-sspi \
        --enable-ipv6 \
        --with-libssh2

error code: CURLE_SSL_CACERT_BADFILE (77)

openssl:
--------
./configure \
        --host='$(TARGET)' \
        --build="`config.guess`" \
        --disable-shared \
        --prefix='$(PREFIX)/$(TARGET)' \
        --without-gnutls \
        --with-ssl \
        --with-libidn \
        --enable-sspi \
        --enable-ipv6 \
        --with-libssh2

error code: CURLE_SSL_CERTPROBLEM (58)

My C code for using libcurl is at
https://github.com/residuum/PuRestJson/blob/master/ctw.c

Thanks for you help,
Thomas

-- 
"As long as people kept worrying that the machines were taking over,
they wouldn't notice what was really happening. Which was that the
programmers were taking over." (Robert Anton Wilson - The Homing Pidgeons)
http://www.residuum.org/
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-05-13