Openssl
From wiki
pem to pfx
openssl pkcs12 -inkey server.domain.com.key -in server.domain.com.pem -export -out server.domain.com.pfx
pem to pfx
openssl pkcs12 -inkey server.domain.com.key -in server.domain.com.pem -export -out server.domain.com.pfx