private function getStreamContext()
    {
        $context = array(
            'ssl' => array(
                'local_cert' => $this->params['ssl_pem_path'],
            ),
        );

        // Handle Certificate Bundle passphrase
        if (!empty($this->params['ssl_passphrase'])) {
            $context['ssl']['passphrase'] = $this->params['ssl_passphrase'];
        }

        return stream_context_create($context);
    }