cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to use Client certificate having .P12 format

From: Seshubabu Pasam <pasam_at_seshubabu.com>
Date: Thu, 10 Mar 2005 02:06:17 -0800

Cut-copy-paste. Also Andy pointed, if you are going to use this for anything other than testing, generate a new set of keys/certs.

This is your private key (include the BEGIN and END lines):
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,0A4EBAD719EF4D37

6+5mCKsYScg580H8aEIRNdlZyuVwqo
pX1xAjYQpPkh2oxHER+iIysclxUwhZzNSo
B9x5r3pUYl5UXje1HeaCx7150tS3KwedJuo9dyniUtvKP6cD7Vj5B5e98eQZAW2s
MwXJwfbNWhBElZuHXTmwRa0ZdVl5AYuoV+h6/AZUmeA+XYBtQJ74gTJoK4Xwh/bw
CCFkvArdx6P6h6V9p3GTTWN5n8irUrt+9xGTguDwtoEbZS/QRZvgTypQmLpsmVDF
R3xqAMd36c142y/kpL405yVm10uZXQbFHkDGPVRabMEz9wFHpSy/A8LR2346Osi9
iG7W6KsFAqpIXZF/QnI/5pF8zWchQ1osQatdPsBQDD+ltc0X30bmWeerfHGSONAo
E2CrjXJ/reMujozqXQXfLBmcFgqfc2Y1l0FEqIC+fxk=
-----END RSA PRIVATE KEY-----

This is your client certificate (include the BEGIN and END lines):
-----BEGIN CERTIFICATE-----
MIICRjCCAfCgAwIBAgIBPDANBgkqhk
iG9w0BAQQFADBnMQswCQYDVQQGEwJVUzEL
MAkGA1UECBMCQ0ExCzAJBgNVBAcTAkNVMREwDwYDVQQKEwhTZWN1cml0eTENMAsG
A1UECxMEUFNQTDEcMBoGA1UEAxMTQ2VydGlmaWNhdGUgTWFuYWdlcjAeFw0wNDEy
MjkxMzI1NDhaFw0wNTEyMjkxMzI1NDhaMIGHMQswCQYDVQQGEwJVUzEOMAwGA1UE
ChMFT2JsaXgxETAPBgNVBAsTCHNlY3VyaXR5MRgwFgYKCZImiZPyLGQBARMIVmFs
aXZldG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GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFAlC0f3HKTZjHSyIkV1W
yaRmGgp4MB8GA1UdIwQYMBaAFAlC0f3HKTZjHSyIkV1WyaRmGgp4MA4GA1UdDwEB
/wQEAwIBhjANBgkqhkiG9w0BAQUFAANBAIPhFX5NclB13rr78O/2g8umEvxDMxSa
1IzwuwFJEU+5nPBFw7cP6u4wszVq7I8NiwVPhureN3LrVPBqCmwCXjQ=
-----END CERTIFICATE-----

-Seshu

Aniruddha Diwakar wrote:
Hello,

but my file contains the both key as well as certificate. how do i separate them ?

Regards
Aniruddha

From: Daniel Stenberg <daniel-curl@haxx.se>
Reply-To: libcurl development <curl-library@cool.haxx.se>
To: libcurl development <curl-library@cool.haxx.se>
Subject: Re: How to use Client certificate having .P12 format
Date: Thu, 10 Mar 2005 08:23:39 +0100 (CET)

On Thu, 10 Mar 2005, Aniruddha Diwakar wrote:

this .pem file contains private key as well as certificate.

now which file should i use for CURLOPT_SSLCERT and CURLOPT_SSLKEY please help me out.

private key file => CURLOPT_SSLKEY (and CURLOPT_SSLKEYPASSWD)

certificate file => CURLOPT_SSLCERT

--
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html

_________________________________________________________________
News, views and gossip. http://www.msn.co.in/Cinema/ Get it all at MSN Cinema!


Received on 2005-03-10