I used PHP 5.5, but I have to upgrade it, and now I am using PHP 5.6.19.
Now, when I try to contact an external API, I get a warning:
Warning: file_get_contents (): partner certificate CN = *.domain.com' did not match expected CN= api.domain.com'
This was not related to a previous version of PHP.
$encryptedEncodedData // this is json encoded //array, then encrypted by mcrypt with rijndael-128 and finally bin2hex. $context = stream_context_create(array( 'http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => $encryptedEncodedData, ) )); $api = 'https://api.domain.com/service'; $response = file_get_contents($api, FALSE, $context);
I do not know what is needed for this warning.
I decided to disable peer veryfi until my administrators fix the certificate issue and I changed the following context:
$context = stream_context_create(array( 'http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/json', 'content' => $encryptedEncodedData, 'verify_peer' => false, 'verify_peer_name' => false, ), ) );
but still not working. Did I do it right? This is a warning.
source share