Combining key and certificate into a pkcs12 file

I just tried it out but get the same message: “No certificate matches private key”.
I’m pretty sure that certificate and private key match since they are in use for an Apache Server.