Remove password from .PFX file

First, extract the certificate:

openssl pkcs12 -clcerts -nokeys -in $PFXIn -out certificate.crt -password pass:$PASSWORD -passin pass:$PASSWORD

Second, the CA key:

openssl pkcs12 -cacerts -nokeys -in $PFXIn -out -password pass:$PASSWORD -passin pass:$PASSWORD

Now, the private key:

openssl pkcs12 -nocerts -in $PFXIn -out private.key -password pass:$PASSWORD -passin pass:$PASSWORD -passout pass:$TEMPPASS

Now remove the passphrase:

openssl rsa -in private.key -out new.key -passin pass:$TEMPPASS

Put things together for the new PKCS-File:

cat new.key certificate.crt > pem.pem

Create the new file:

openssl pkcs12 -export -nodes -CAfile -in pem.pem -out $PFXOut -passout pass:

And ... cleanup:

rm -f certificate.crt $PFXIn private.key new.key pem.pem

Now you have a new PKCS12 key file without passphrase on the private key part.