public function getServerCertificateChain() { $blocks = explode("\n---\n", $this->_connection->getOutput()); $certificateOutput = $blocks[1]; $certificatesFound = sspmod_janus_OpenSsl_Certificate_Utility::getCertificatesFromText($certificateOutput); return sspmod_janus_OpenSsl_Certificate_Chain_Factory::createFromCertificates($certificatesFound); }
public static function loadRootCertificatesFromFile($filePath) { if (!file_exists($filePath)) { throw new Exception("Unable to load Root certificates, file '{$filePath}' does not exist"); } $fileContents = file_get_contents($filePath); $certificatesFound = sspmod_janus_OpenSsl_Certificate_Utility::getCertificatesFromText($fileContents); self::setRootCertificates($certificatesFound); }