Created
June 22, 2018 15:59
-
-
Save dsueiro/1988bea2e62aff890b1a56d124e37fc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function hasValidCert() | |
{ | |
if (!isset($_SERVER['SSL_CLIENT_M_SERIAL']) | |
|| !isset($_SERVER['SSL_CLIENT_V_END']) | |
|| !isset($_SERVER['SSL_CLIENT_VERIFY']) | |
|| $_SERVER['SSL_CLIENT_VERIFY'] !== 'SUCCESS' | |
|| !isset($_SERVER['SSL_CLIENT_I_DN']) | |
) { | |
return false; | |
} | |
if ($_SERVER['SSL_CLIENT_V_REMAIN'] <= 0) { | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment