php 查看ssl证书日期
<?php $domain = "ixex.io"; $g = stream_context_create(array('ssl' => array("capture_peer_cert_chain" => true))); $r = stream_socket_client("ssl://$domain:443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $g); $cont = stream_context_get_params($r); foreach($cont["options"]["ssl"]["peer_certificate_chain"] as $key => $val){ //使用openssl扩展解析证书 $cerInfo = openssl_x509_parse($val); if(strpos($cerInfo['name'], $domain)){ echo "start:".date('Y-m-d', $cerInfo['validFrom_time_t'])."<br>"; echo "end:".date('Y-m-d', $cerInfo['validTo_time_t']); } }
MySQL 从库日志比主库多
MYSQL主库宕机,从库设置为主库,主库重启之后,从库日志比主库日志多。