php 查看ssl证书日期

2019-6-26 Stone PHP

<?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']);
	}
}

标签: php SSL证书

评论(0) 浏览(907)

MySQL 从库日志比主库多

2019-6-20 Stone mysql

MYSQL主库宕机,从库设置为主库,主库重启之后,从库日志比主库日志多。

详情连接 https://www.linuxidc.com/Linux/2016-01/128002.htm

标签: mysql 从库日志比主库多

评论(0) 浏览(729)

Copyright © 2019 by 海角孤星 京ICP备15056837号-1