Re: Help Converting curl.exe command to pycurl - possible solution.

From: Peter Schott <>
Date: Thu, 26 May 2005 15:01:13 -0500

Cool stuff here. Found out that this was an example of my certificate
containing both a CA and a Client portion. I was able to split out the
Client portion using:
     openssl pkcs12 -in SigningCertificate.P12 -out Client.pem -clcerts
Then I used the following:
pycurl.SSLKEY, Original.pem
pycurl.SSLKEYPASSWD, Password
pycurl.SSLCERT, Client.pem
pycurl.SSLCERTPASSWD, Password
This seems to be working, though I'm stepping through a _bunch_ of
redirects now. I'm pretty sure that's due to some oddity on the target
site. It's been slow lately and this would explain why.
I appreciate all of you who helped point me in the right direction and
hope this will be useful to someone else if they encounter a similar
Peter A. Schott


From: Peter Schott
Sent: Thursday, May 26, 2005 10:13 AM
To: ''
Subject: Re: Help Converting curl.exe command to pycurl

OK - trying that now, but when I set SSLCERT = the same PEM file, I get:
debug - unable to set private key file: 'D:/MyCert.pem' type PEM
regular output - ''' pycurl.error : (58, "unable to set private key
file: D:/MyCert.pem' type PEM\n") '''
Am I doing something wrong by trying to pass in (pycurl.SSLCERT, MyCert)
for values? Is this supposed to be a list or dictionary instead of a
I've just done a little more checking and found that SSLCERT does take a
string which is what I'm passing. However, it still returns that error
whenever I set the SSLCERT option to a full path/filename for my

> OK - I can kind of see that, but why don't I get prompted for this
when I
> use curl.exe? I don't pass this in for my command line and it works.

Aaaah. Now I finally start to understand... Sorry for being slow.

I went back and compared your python with the command line, and spotted
you use -E but you don't pass in your certificate (using SSLCERT) in the

python program. You only pass in the SSLKEY, and both are likely to be

curl -E assumes that your privaate key and client cert are both kept in
same PEM file.


This e-mail is covered by the Electronic Communications Privacy Act, 18 U.S.C.
Sections 2510-2521. The information contained in this e-mail is confidential
and intended only for use of the individual or entity named above. If the reader
of this message is not the intended recipient, or the employee or agent
responsible to deliver it to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this message in error or there are any problems
please notify the originator immediately.

The unauthorized use, disclosure, copying or alteration of this message is
strictly forbidden. This mail and any attachments have been scanned for viruses
prior to leaving the Drive Financial Services network. Drive Financial Services
will not be liable for direct, special, indirect or consequential damages arising
from alteration of the contents of this message by a third party or as a result of
any virus being passed on.

Received on 2005-05-26