Extending Arnold Roa's answer above, which was specifically referring to the Authorize.net IPN gateway.
Setting the VERIFY_PEER also works for Authorize.net AIM gateway.
Keep in mind that setting VERIFY_PEER = false is a TEMPORARY patch. Don't plan to leave it like that.
$transaction = new AuthorizeNetAIM()
$transaction->VERIFY_PEER = false;
It's a good idea to update the SDK on the regular. However, since updates often break more things than they fix, it's possible to update the cert.pem file without updating the entire SDK / code library.
If you're getting
Error connecting to AuthorizeNet
and you haven't updated the SDK code / directory in years then it's most likely because your SDK has an older, now deprecated, SHA1 certificate file. It uses that lib/ssl/cert.pem file to compare to the certificate sent back by secure.authorize.net and make sure they match. This is an added layer of security to protect.
If you replace the contents of lib/ssl/cert.pem with the full contents of the latest cert.pem from the PHP SDK repository https://github.com/AuthorizeNet/sdk-php/blob/master/lib/ssl/cert.pem
then the error should go away.
After you've replace the cert.pem file remember to re-enable the peer verification, like
$transaction->VERIFY_PEER = true;
That should fix it, at least until Authorize.net gets a new certificate (usually every 3-4 years), at which point you'd need to update the cert.pem file, or the full SDK, again.