Not a definite answer, but too big to fit in the comments:
I assume that they gave you a certificate that either has the wrong issuer (although their server can use a more specific warning code for it), or the wrong object. We know that cert matches your private key, because both curl and openssl client paired them without complaining about the mismatch; but we don’t really know that it matches their desired CA (s) - since your curl uses openssl and the openssl SSL client DOES NOT use the configured client certificate to match certreq.CAs.
Make openssl x509 <clientcert.pem -noout -subject -issuer and the same thing on the certificate from the P12 test that works. Make openssl s_client (or check the one you made) and look under Acceptable client certificate CA names ; the name there or one of them must correspond (exactly!) to the issuer (s) of your certificates. If not, then most likely your problem, and you need to check with them, you sent your CSR to the right place and right. Perhaps they have different modes in different regions or business areas, or they are testing vs prod, or actively against pending ones, etc.
If the issuer of your certificate meets the desired CAS, compare its subject with the working one (test-P12): are they in the same format? are there any components in the workspace that aren’t in yours? If they allow this, try creating and sending a new CSR with the subject name exactly the same as the test P12, or as close to it as possible, and see if it creates a certificate that works better. (You do not need to generate a new key to do this, but if you decide, keep track of which certificates correspond to these keys so that you do not mix them.) If this does not help to look at the extension certificate with openssl x509 <cert -noout -text for any differences (s) that can reasonably be associated with authorization of an object, for example, KeyUsage, ExtendedKeyUsage, perhaps policies, possibly restrictions, maybe even something non-standard.
If all else fails, ask the server operator (s) what their logs say about the problem, or if you have access to the logs themselves.
source share