curl: (58) schannel: Failed to import cert file cert.pem, last error is 0x80092002

I'm trying to test my certificate files with curl like this:

curl -XPOST -H "Content-type: application/json" -d '{"merchantIdentifier":"merchant..xxxxx","displayName":"TestPay","initiative":"web","initiativeContext":"-***-xxxxxx.xxxxxxxxxx.xx"}' --cert cert.pem:cert.pem 'https://apple-pay-gateway-cert.apple.com/paymentservices/startSession'

And I'm receing an error: Failed to import cert file cert.pem, last error is 0x80092002

I would check your cert.pem file. That sounds like it's not in PEM format. If it is, you should be able to open it in a text editor and see something like "BEGIN CERTIFICATE" near the top.

PEM files are ASCII, but they are base64 encoded. You won't be able to read any of the details, but there shouldn't be any special characters.

curl: (58) schannel: Failed to import cert file cert.pem, last error is 0x80092002
 
 
Q