Skip to content

Instantly share code, notes, and snippets.

@dsueiro
Created June 22, 2018 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsueiro/1988bea2e62aff890b1a56d124e37fc3 to your computer and use it in GitHub Desktop.
Save dsueiro/1988bea2e62aff890b1a56d124e37fc3 to your computer and use it in GitHub Desktop.
<?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