cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: verbose and debug callback

From: Peter Sylvester <Peter.Sylvester_at_EdelWeb.fr>
Date: Tue, 29 Jul 2003 15:08:16 +0200 (MEST)

In the latest pre-release you can do something like (I removed
most of unrelated code)

typedef struct sslctxparm_st {
   unsigned char * p12file ;
   const char * pst ;
   PKCS12 * p12 ;
   EVP_PKEY * pkey ;
   X509 * usercert ;
   STACK_OF(X509) * ca ;
   CURL * curl;
   BIO * b;

} sslctxparm;

...

static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
        {
        sslctxparm * p = (sslctxparm *) arg;
        int ok;
        fprintf(stderr,"in verify call back n");

        if ((ok= X509_verify_cert(ctx)) && ctx->cert)
                 X509_print_ex(p->b,ctx->cert,0,0);
        return(ok);
}

..

static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) {
        sslctxparm * p = (sslctxparm *) parm;
        SSL_CTX * ctx = (SSL_CTX *) sslctx ;
        fprintf(stderr,"in sslctxfun\n");

...
        SSL_CTX_set_cert_verify_callback(ctx, ssl_app_verify_callback, parm);
...
        return CURLE_OK ;
}

...
  
    res = curl_easy_setopt(easyhandle, CURLOPT_SSL_CTX_FUNCTION, sslctxfun);
    curl_easy_setopt(easyhandle, CURLOPT_SSL_CTX_DATA, &p);

...

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-07-29