This can occur due to the antivirus HTTPs checking, like in Avast in my case. I solved exporting the Avast cerfificate to the cerificate bundle file used by the PHP