BadSSL表示此Url https://revoked.badssl.com/具有SSL吊銷證書。爲什麼它撤銷了SSL證書?
在PHP中,從SSL證書到期日期設置爲2019-09-11 12:00:00
$url = "https://revoked.badssl.com/";
$orignal_parse = parse_url($url, PHP_URL_HOST);
$get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE)));
$read = stream_socket_client("ssl://".$orignal_parse.":443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);
$cert = stream_context_get_params($read);
$certinfo = openssl_x509_parse($cert['options']['ssl']['peer_certificate']);
$validFrom = date('Y-m-d H:i:s', $certinfo['validFrom_time_t']);
$validTo = date('Y-m-d H:i:s', $certinfo['validTo_time_t']);
$current = date('Y-m-d H:i:s', time());
$validFrom = 2016-09-02 00:00:00
$validTo = 2019-09-11 12:00:00
$current = 2017-02-20 19:00:00
$validFrom > $current : False
$validTo < $current : False
我認爲,證書如果$validFrom > $current OR $validTo < $current
撤銷。情況並非如此。
我可以用PHP & cURL庫來扣除,這是不可能檢查證書吊銷。如果證書被所有者破壞和撤銷,您將永遠不會知道它。這是對的嗎?
證書可以在過期之外被撤銷,否? – Bytewave
是的!如@pedrofb所示,已撤銷!=已過期。 – LeMoussel