CURL SSL "Bad Certificate" Certificate Error

I'm trying to send an SSL certificate with a soap message to the server, and I just managed to get cURL to accept the certificate (put the file with the .pem extension by placing the .pfx file through OpenSSL) and not return β€œunable to install the private key file” (obviously, that the private key must retain its "bag" attributes), but now it returns new new errors:

SSL certificate problem, make sure the CA certificate is in order. Details: error: 14090086: SSL procedures: SSL3_GET_SERVER_CERTIFICATE: certificate verification completed

I tried to install a CA certificate using

curl_setopt($soap_do, CURLOPT_CAINFO, $caFile); 

But this does not give any results with the root or with the intermediate ca files that I have.

Disabling this check with:

 curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, 0); 

brings me back to a new problem:

error: 14094412: SSL routines: SSL3_READ_BYTES: sslv3 warning bad certificate

It has already been a few seconds by my side, and while new error messages mean changes, I'm not sure if this is progress. Any advice or suggestions regarding what is missing / I'm doing wrong will be very helpful.

+6
source share
1 answer

most likely, the CA package is illegal. check permissions and permissions, maybe try setting the absolute path. if this does not help, get the CA kit and set it as curl_setopt($soap_do, CURLOPT_CAINFO,'cacert.pem');

0
source

Source: https://habr.com/ru/post/947657/


All Articles