|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67500 Allow to define time in openssl_x509_checkpurpose
Submitted: 2014-06-23 09:03 UTC Modified: 2015-03-04 21:22 UTC
From: dominic dot tubach at to dot com Assigned:
Status: Wont fix Package: OpenSSL related
PHP Version: 5.5.13 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
6 + 11 = ?
Subscribe to this entry?

 [2014-06-23 09:03 UTC] dominic dot tubach at to dot com
The OpenSSL verify command allows to specify a timestamp to use for the check instead of the current system time (option -attime). Can this possibility be added to the openssl_x509_checkpurpose function?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-04 21:22 UTC]
-Status: Open +Status: Wont fix
 [2015-03-04 21:22 UTC]
I don't believe that is the correct place to check for this type of thing.

The functionality you're looking for is already available using openssl_x509_parse() to determine if the certificate is valid at a given timestamp as shown here:

$cert = ...; // get the cert from somewhere
$info = openssl_x509_parse($cert);
$time = time(); // or any other timestamp;
$isValid = ($info['validFrom_time_t'] < $time && $time < $info['validTo_time_t']);
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 30 18:01:33 2024 UTC