title: cURL with a PKCS#12 certificate in a bash script
body: <p>i have to connect to a webservice, where a pkcs12 certificate is a must. the idea was to use curl in a bash script (under OS X, to be specific).</p>
  
  <p>i have learnt that one of the few things curl cannot do in communication, is handling pkcs12 certificates (.p12). what are my options?</p>
  
  <p>i have read that converting the certificate to PEM format would work (using openssl), however i have no idea how to tell curl that it gets a PEM and should communicate with a webservice requesting PKCS12 certificates.</p>
  
  <p>converting pkcs12 to pem would be done like this (e.g.), it worked for me, however i haven't successfully used them with curl:</p>
  
  <pre><code>openssl pkcs12 -in mycert.p12 -out file.key.pem -nocerts -nodes
  openssl pkcs12 -in mycert.p12 -out file.crt.pem -clcerts -nokeys
  </code></pre>
  
  <p>any hints? or, any alternatives to curl? the solution should be commandline based.</p>