lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Sep 11, 2007 at 10:25:56AM +0200, Luc1an0 wrote:
> 2007/9/10, Jeff Pohlmeyer <yetanothergeek@gmail.com>:
> >
> > On 9/10/07, Luc1an0 <luc1an0@free.fr> wrote:
> > > > local f=io.open("X:\My\certificate\file.crt")
> > > ...
> > > > c:setopt(curl.OPT_SSLCERT,cert)
> > >
> > >
> > > Hello, Luc1an0 -
> > >
> > > I am not familiar with LuaCurl, but I see in the curl_easy_setopt
> > > documentation:
> > >
> > > CURLOPT_SSLCERT:   The string should be the *filename* of your
> > > certificate.
> >
> >
>  I had try with the filename but I have an error too...
> 58      unable to set private key file: 'my.certicate.crt' type PEM

I found an example on the web, it seems you need to specofy more
optionsi (it's C, but the translation is trivial):

curl_easy_setopt(curl,CURLOPT_SSLCERT,pCertFile);
curl_easy_setopt(curl,CURLOPT_SSLKEYPASSWD,pPassphrase);
curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE,pKeyType);
curl_easy_setopt(curl,CURLOPT_SSLKEY,pKeyName);
curl_easy_setopt(curl,CURLOPT_CAINFO,pCACertFile);
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1); 

Cheers
-- 
Enrico Tassi