php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dominic dot tubach at to dot com
New email:
PHP Version: OS:

 

 [2014-06-23 09:03 UTC] dominic dot tubach at to dot com
Description:
------------
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?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-04 21:22 UTC] rdlowrey@php.net
-Status: Open +Status: Wont fix
 [2015-03-04 21:22 UTC] rdlowrey@php.net
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:

<?php
$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: Fri Apr 19 10:01:28 2024 UTC