DvDaf Thx mate! That did it! I had added CA cert file and edited php.ini file, adding line
curl.cainfo = "C:\PHP\v8_1_11\certs\cacert.pem"
but I was missing the second one,
openssl.cafile= "C:\PHP\v8_1_11\certs\cacert.pem"
I also thought I was editing the right .ini file, but after double checking I realized it was using a different .ini since our server is full of PHP folders of older installations. Now everything seems to be working properly.