What could be the reason for this behavior of this piece of code - other requests are executed, the domain is available with a certificate, but I don’t? Checked a huge number of options - from the environment, ending with my tests on win (now ubuntu). PHP - from 5.6 to 7.2, OpenSSL 1.1.0h

$context = stream_context_create( array( 'ssl' => array( 'verify_peer' => true, 'local_cert' => $cert_file, 'cafile' => $ca_file, 'passphrase' => '123456', ), ) ); file_get_contents($loc, false, $context); 

Mistake:

 Warning: file_get_contents(): Unable to set local cert chain file `/var/www/empirethx/source/config/files/CFT/certificate_dev/test_api_36022_1.pem'; Check that your cafile/capath settings include details of your certificate and its issuer in /var/www/empirethx/source/init.php on line 160 Warning: file_get_contents(): Failed to enable crypto in /var/www/empirethx/source/init.php on line 160 Warning: file_get_contents(some url....): failed to open stream: operation failed in /var/www/empirethx/source/init.php on line 160 

I selected this piece of code in a separate file, ran it from sudo, changed the rights to services, set up clean php, made a request through different versions of php, reinstalled the smoker, openssl, ca-certs. It was cryptopro - deleted. Nothing helps.

UPD - When using curl request through PHP, there are no problems, so I can assume that it is in stream_context_create. Any ideas?

  • Comments are not intended for extended discussion; conversation moved to chat . - Yuriy SPb

0