Hi again folks, has anyone got any thoughts on this one? Still stuck :-)
OpenSSL 'Failed to enable crypto' error on Ubuntu Digital Ocean Droplet
Hi all,
I am using Guzzle to connect with the Zoopla Property Group Api as follows:
$client = new \GuzzleHttp\Client([ 'exceptions' => false ]);
$request = $client->post('https://realtime-listings-api.webservices.zpg.co.uk/sandbox/v1/listing/list', array(
'ssl_key' => 'path/to/my/private.pem',
'cert' => 'path/to/my/zpg.crt',
'json' => ['branch_reference' => '123456'],
'headers' => [
'content-type' => 'application/json;profile=http://realtime-listings.webservices.zpg.co.uk/docs/v1.1/schemas/listing/list.json',
]
));
Locally I am using Laravel Homestead and have been able to connect and work fine.
However, I am now wanting to test live and so I have deployed this to a new Digital Ocean Ubuntu (version 16.04 x64) droplet and when I try and make the same call as above I get the following output:
Error creating resource: [message] fopen(): Unable to set private key file `/var/www/mydomain.co.uk/path/to/my/zpg.crt'
[file] /var/www/mydomain.co.uk/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 287
[message] fopen(): Failed to enable crypto
[file] /var/www/mydomain.co.uk/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
[line] 287 [message] fopen(https://realtime-listings-api.webservices.zpg.co.uk/sandbox/v1/listing/list):
failed to open stream: operation failed
[file] /var/www/mydomain.co.uk/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
I believe that the answer may lie in the
fopen(): Failed to enable crypto
line but I'm struggling to find anything which may help. All file paths are correct, and the file permissions are set the same as locally where it is working. Is this just a simple case of needing to enable a setting or install something extra on my droplet? Any help would be greatly appreciated.
Many thanks, Lewis
Please or to participate in this conversation.