private function getContextOptions()
    {
        $opts = array(
            'http'=>array(
                'ignore_errors' => true,
                'header' => "Accept: application/json, */*\r\nContent-Encoding: gzip\r\n"
            ),
        );

        if (!empty($this->config->getCertificateAuthorityPath())) {
            $opts['ssl']['cafile'] = $this->config->getCertificateAuthorityPath();
        }

        if (!empty($this->config->getClientCertificatePath())) {
            $opts['ssl']['local_cert'] = $this->config->getClientCertificatePath();
        }

        if (!empty($this->config->getClientKeyPath())) {
            $opts['ssl']['local_pk'] = $this->config->getClientKeyPath();
        }

        $token = $this->config->getToken();
        if (!empty($token)) {
            $opts['http']['header'] .= "Authorization: Bearer ${token}\r\n";
        }

        return $opts;
    }