$ openssl pkcs12 -in /path/to/my/cert.p12 -out /pathto/my/cert.pem
If you get “X509_check_private_key:key values mismatch” e.g. with stunnel, then try adding -clcerts
$ openssl pkcs12 -clcerts -in /path/to/my/cert.p12 -out /pathto/my/cert.pem
$ openssl pkcs12 -in /path/to/my/cert.p12 -out /pathto/my/cert.pem
If you get “X509_check_private_key:key values mismatch” e.g. with stunnel, then try adding -clcerts
$ openssl pkcs12 -clcerts -in /path/to/my/cert.p12 -out /pathto/my/cert.pem
There’s a bug in (at least some versions of) Ubuntu, which means the wrong library is being picked up.
https://bugs.launchpad.net/ubuntu/+source/subversion/+bug/294648
Workaround: LD_PRELOAD=/usr/lib/libneon.so.27 svn