"Connection refused" when implementing PHP SDK

Hey there, I’ve started implementing the PHP SDK today. Calling any get function on the client (such as getEntries, getEntry or getEnvironment) leads to an exception with the message “Connection refused for URI https://cdn.contentful.com/spaces/[SPACEID]/environments/dev/locales”.

I can confirm that my credentials are correct, because when I construct the URL myself (with the access token appended as a query parameter) I’m getting a successful response.

My implementation is as basic as it can be.

// init.php
require '../vendor/autoload.php';

// loading $_ENV with .env vars, defining error handler

function get_client()
{
    return new \Contentful\Delivery\Client($_ENV['CONTENTFUL_ACCESSTOKEN'], $_ENV['CONTENTFUL_SPACEID'], $_ENV['CONTENTFUL_ENVIRONMENT']);
}
// api/getProjects.php
namespace LauraMedia\Api;

require 'init.php';
$client = get_client();

var_dump($client->getEnvironment());