LoginSignup
2
2

More than 5 years have passed since last update.

閲覧者の自己署名証明書 有効期限を出力

Posted at

参考

  • $_SERVER['SSL_CLIENT_V_END'] に 閲覧者の有効期限が入っている。
function check_ssl_client_v_end() {
        if (empty($_SERVER['SSL_CLIENT_V_END'])) {
                //echo "no ssl";
                return false;
        }
        if (strtotime($_SERVER['SSL_CLIENT_V_END']) < strtotime("+3 month")) {
            echo "[warning] Your certificate will expire on ";
            echo date("Y-m-d D", strtotime($_SERVER['SSL_CLIENT_V_END']));
        }
}

check_ssl_client_v_end();
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2