public static function getTestChain($name) { $path = TESTING_DIRECTORY . '/Certs/' . $name . '/'; if (!file_exists($path) || !is_dir($path)) { throw new \Exception('Requested certificate files not found at: ' . $path); } $certPaths = array(); $files = scandir($path); foreach ($files as $file) { if (substr($file, -4) !== '.crt') { continue; } $certPaths[] = $path . $file; } return CertFactory::getCertFromFiles($certPaths); }
/** * @expectedException RuntimeException */ public function testGetCertFromServerException() { CertFactory::getCertFromServer('localhost', 30000); }