cURL / Mailing Lists / curl-library / Single Mail

curl-library

.NET library

From: Talal Sultan <Talal.Sultan_at_alpvision.com>
Date: Mon, 22 Jan 2007 10:06:37 +0100

Hi people,

 

 

I am a new user of the library. I have downloaded the .Net version by
Jeff Phillips. I am trying to connect to an SSL site. I have a DER
certificate. When I launch, I keep getting the error
CURLE_SSL_CERTPROBLEM. My code is:

 

FileStream fs = new FileStream("input.xml", FileMode.Open,

                   FileAccess.Read, FileShare.Read);

 

Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL);

 

Easy easy = new Easy();

 

Easy.WriteFunction wf = new Easy.WriteFunction(OnWriteData);

CURLcode code;

code = easy.SetOpt(CURLoption.CURLOPT_WRITEFUNCTION, wf);

 

Easy.ReadFunction rf = new Easy.ReadFunction(OnReadData);

code = easy.SetOpt(CURLoption.CURLOPT_READFUNCTION, rf);

code = easy.SetOpt(CURLoption.CURLOPT_READDATA, fs);

 

Easy.SSLContextFunction sf = new Easy.SSLContextFunction(OnSSLContext);

code = easy.SetOpt(CURLoption.CURLOPT_SSL_CTX_FUNCTION, sf);

 

code = easy.SetOpt(CURLoption.CURLOPT_URL,
"https://somesite/file.php");

 

code = easy.SetOpt(CURLoption.CURLOPT_SSLCERT, "certificate.der");

code = easy.SetOpt(CURLoption.CURLOPT_SSLCERTTYPE, "DER");

code = easy.SetOpt(CURLoption.CURLOPT_SSLKEYPASSWD, "mypass");

code = easy.SetOpt(CURLoption.CURLOPT_SSLENGINE_DEFAULT, 1);

code = easy.SetOpt(CURLoption.CURLOPT_INFILESIZE, fs.Length);

code = easy.Perform();

easy.Cleanup();

Curl.GlobalCleanup();

 

Any help is greatly appreciated.

 

Thanks,

 

Talal

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
Received on 2007-01-22