You are here

private function StreamHandler::add_cert in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php \GuzzleHttp\Handler\StreamHandler::add_cert()

File

vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php, line 371

Class

StreamHandler
HTTP handler that uses PHP's HTTP stream wrapper.

Namespace

GuzzleHttp\Handler

Code

private function add_cert(RequestInterface $request, &$options, $value, &$params) {
  if (is_array($value)) {
    $options['ssl']['passphrase'] = $value[1];
    $value = $value[0];
  }
  if (!file_exists($value)) {
    throw new \RuntimeException("SSL certificate not found: {$value}");
  }
  $options['ssl']['local_cert'] = $value;
}