You are here

public function PantheonCurl::createHandle in Search API Pantheon 8

File

src/Solarium/PantheonCurl.php, line 16
Override Solarium so that more options can be set before executing curl.

Class

PantheonCurl

Namespace

Drupal\search_api_pantheon\Solarium

Code

public function createHandle($request, $endpoint) {
  $handler = parent::createHandle($request, $endpoint);
  if (defined('PANTHEON_ENVIRONMENT')) {
    curl_setopt($handler, CURLOPT_SSL_VERIFYPEER, FALSE);
    $client_cert = $_SERVER['HOME'] . '/certs/binding.pem';
    curl_setopt($handler, CURLOPT_SSLCERT, $client_cert);
  }
  return $handler;
}