0

I have next code:

$stream_context_create = stream_context_create([
    'ssl' => [
        'local_cert'        => $ssl_key2,
        'allow_self_signed' => true
    ]
]);

$response = file_get_contents($url, false, $stream_context_create);

But when I trying to run it I receive an error:

Warning: file_get_contents(): Unable to set local cert chain file `/tmp/1.pem'; Check that your cafile/capath settings include details of your certificate and its issuer in /srv/index.php

I work on PHP7.0 and OpenSSL 1.1.0f

url works in browser. but can't get content from code.

Whats wrong?

user2264941
  • 407
  • 1
  • 8
  • 23

0 Answers0