You are here

public function CasServerConfig::getCasServerGuzzleConnectionOptions in CAS 8

Same name and namespace in other branches
  1. 2.x src/CasServerConfig.php \Drupal\cas\CasServerConfig::getCasServerGuzzleConnectionOptions()

Gets config data for guzzle communications with the CAS server.

Return value

array The guzzle connection options.

File

src/CasServerConfig.php, line 284

Class

CasServerConfig
Class CasServerConfig.

Namespace

Drupal\cas

Code

public function getCasServerGuzzleConnectionOptions() {
  $options = [];
  $verify = $this
    ->getVerify();
  switch ($verify) {
    case CasHelper::CA_CUSTOM:
      $cert = $this
        ->getCustomRootCertBundlePath();
      $options['verify'] = $cert;
      break;
    case CasHelper::CA_NONE:
      $options['verify'] = FALSE;
      break;
    case CasHelper::CA_DEFAULT:
    default:
      $options['verify'] = TRUE;
  }
  $options['timeout'] = $this
    ->getDirectConnectionTimeout();
  return $options;
}