public static function verify_certificate($host,
$cert) { if (InputValidator::
is_string_or_stringable($host) === false
) { throw InvalidArgument::
create(1, '$host', 'string|Stringable',
gettype($host));
} if (InputValidator::
has_array_access($cert) === false
) { throw InvalidArgument::
create(2, '$cert', 'array|ArrayAccess',
gettype($cert));
} $has_dns_alt = false;
// Check the subjectAltName
if (!
empty($cert['extensions'
]['subjectAltName'
])) { $altnames =
explode(',',
$cert['extensions'
]['subjectAltName'
]);
foreach ($altnames as $altname) { $altname =
trim($altname);
if (strpos($altname, 'DNS:'
) !== 0
) {