cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SSL sample

From: Henrik Storner <henrik-curl_at_hswn.dk>
Date: Tue, 30 Sep 2003 22:02:43 +0200

On Tue, Sep 30, 2003 at 12:07:51PM -0700, Jerry G. Chiuan wrote:
> > On Sun, Sep 28, 2003 at 01:12:42PM -0700, Jerry G. Chiuan wrote:
> > > Hi All,
> > > does anybody know where we can get SSL example on libcurl site?
> >
> > SSL-enabled URL's are handled just like non-SSL URL's. All of
> > the SSL stuff is handled internally by libcurl - *if* you
> > compiled it with SSL support (run configure with "--with-ssl").
>
> therefore, do we need to set those stuff as below?
> Or, libcurl can handle internally

You normally don't need these.

> 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);

These are for *client* side certificates, where you use a
certificate to authenticate towards the server. Like a login
procedure, but with certificates instead of username/password.

> curl_easy_setopt(curl,CURLOPT_CAINFO,pCACertFile);
> curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1);

These determine if/how libcurl verifies the validity of the
server certificate. Validation is turned on by default; you
can disable it with the VERIFYPEER option.

See the curl_easy_setopt man page - it has much more details
about all of these settings.

-- 
Henrik Storner <henrik_at_hswn.dk> 
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-30