Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lewiscainscube's avatar

Using Guzzle with OpenSSL

Hi folks,

Hopefully someone can help me here. I'm developing a website in the UK that needs to post properties to Zoopla and Prime Location. I'm using this facility (# shows the security required) https://realtime-listings.webservices.zpg.co.uk/docs/latest/documentation.html#security

HTTP/Authentication stuff like this an area I struggle with so I would love it if someone is able to get me up and running.

Basically I've followed all the steps mentioned on the above page and I am now in possession of a certificate returned and signed from them. What I'm struggling with is configuring Guzzle to authenticate and use this API. I have a private.pem file and a signed.crt file (that they have given).

My best attempt so far is:

$client = new \GuzzleHttp\Client([ 'exceptions' => false ]);
$request = $client->get('https://realtime-listings-api.webservices.zpg.co.uk/sandbox/v1/listing/list', array(), array(
    'cert'      => '/Applications/MAMP/htdocs/mywebsite/signed.crt',
    //'ssl_key'   => '/Applications/MAMP/htdocs/mywebsite/private.pem'
));
var_dump($request->getBody());

But this just gives me an error of:

cURL error 35: Unknown SSL protocol error in connection to realtime-listings-api.webservices.zpg.co.uk:443 (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

This whole concept is new to me, so if anyone is able to offer some assistance to get me connected I'd be very grateful.

Thanks all, much appreciated, Lew

0 likes
4 replies
kingpin's avatar

The docs that you reference actually tell you that you need to use TLS 1.2:

CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2

Make sure that Guzzle uses this for the curl config and give that a go.

lewiscainscube's avatar

Hi @kingpin thanks very much, you're spot on. My system doesn't support that so am going to have to get a homestead box going and also get my server updated to centos7. That should hopefully put me on the right track. Thanks for your help, much appreciated

jekinney's avatar

@lewiscainscube

Keep in mind homestead uses Ubuntu and you might have deployment issues with centos. Not sure, just something to keep in mind. Generally speaking the point of using a vm is to exactly mimic your deployment server.

Please or to participate in this conversation.