I switched from PHP 5.4 to 5.6 on my production system (running on a shared hosting provider). My queries of a particular website are now getting the error "stream_socket_client(): Peer certificate CN='(redacted).com' did not match expected CN='(redacted).com.au'"
The website owner says he's using a single Let's Encrypt certificate to cover multiple domains.
My staging system (running on a Synology NAS) is also running PHP 5.6 and it does not get this error.
I'm using HTTP_Request2 and trying to disable verification, i.e.:
$query = new HTTP_Request2($url, HTTP_Request2::METHOD_GET,
array('connect_timeout' => 2, 'timeout' => 4));
$query->setConfig(array(
'ssl_verify_peer' => FALSE,
'ssl_verify_host' => FALSE,
));
and yet I still get the error on the production system.
Security is not critical in this application. I'd rather have my code tolerate the site's certificate than ask the site to change their certificates (which they might refuse to do).
How can I make this work?
Thank you,
Bob