cURL / Mailing Lists / curl-library / Single Mail


How to convert SSL certificate into .PEM

From: Ali Yildirim <>
Date: Wed, 01 Oct 2003 11:34:49 +0000

Hello all,
I get the folowing results when I execute a curl command attempting to
access a secure site:

D:\cURL\ssl>curl -v --cacert mycert.pem -o test.txt
* About to connect() to
* Connected to ( port 443
* SSL: error:00000000:lib(0):func(0):reason(0)
* Closing connection #0
curl: (35) SSL: error:00000000:lib(0):func(0):reason(0)


I am using curl-7.10.3 ssl version under Win32.

Here is how I generate mycert.pem from SSL certificate of web site
(a) Open up using MSIE 5.5
(b) Double click on the lock sign on MSIE status bar
(c) Click on Details tab
(d) Click on "Copy to File" button
(e) Click on Next on Certificate Export Wizard window
(f) Select "Base-64 encoded X.509 (.CER)" and then click on Next
(g) Enter d:\mycert.cer into file name input area
(h) Press Finish button to complete exporting certificate
(i) and finally use openssl to generte mycert.pem file
    openssl x509 -in mycert.cer -outform PEM -out mycert.pem

What am I doing wrong here? Can anybody tell me how to get .pem file
from IIS or the secure site itself?

By the way, when I turn off cURL's certificate verification
(by using -k option instead of --cacert), the above cURL command
runs with no errors.

Thanks a lot,

Ali Yildirim


This email is sponsored by:ThinkGeek
Welcome to geek heaven.
Received on 2003-10-01