Last active
November 22, 2016 23:41
-
-
Save philals/e56eaac76e5eaf502fa8a4ceba9d2dd8 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
if ($this->config ['application_type'] == 'Partner') { | |
if (! file_get_contents ( $this->config ['curl_ssl_cert'] )) { | |
$testOutput ['ssl_cert_error'] = "Can't read the Xero Entrust cert. You need one for partner API applications. http://developer.xero.com/documentation/getting-started/partner-applications/ \n"; | |
} else { | |
$data = openssl_x509_parse ( file_get_contents ( $this->config ['curl_ssl_cert'] ) ); | |
$validFrom = date ( 'Y-m-d H:i:s', $data ['validFrom_time_t'] ); | |
if (time () < $data ['validFrom_time_t']) { | |
$testOutput ['ssl_cert_error'] = "Xero Entrust cert not yet valid - cert valid from " . $validFrom . "\n"; | |
} | |
$validTo = date ( 'Y-m-d H:i:s', $data ['validTo_time_t'] ); | |
if (time () > $data ['validTo_time_t']) { | |
$testOutput ['ssl_cert_error'] = "Xero Entrust cert expired - cert valid to " . $validFrom . "\n"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment