I'm currently trying to find out how a server handles OCSP stapling and want to view how often it is getting it's certificate signed. According to RFC 6066 (if I'm reading it right), the certificate and a time stamp should be signed and returned under status_request
, if a CertificateStatus message is present. How can I view the timestamped certificate and it's corresponding signature? So far I've used Wireshark which does not seem to show this response as far as I can see. I've used curl which I think is verifying the certificate however I can't actually see the time stamped certificate (* SSL certificate status: good (0)
).
As a side question how recent does a timestamped certificate need to be for it to be valid?
Thanks in advance
You can use the
openssl s_client
command with the-status
flag to send a certificate status request to the server. If the server supports OCSP stapling, you'll see the details of the OCSP response in the data, including the signature over it.For example, if we try it with stackoverflow.com:
In terms of how recent the response needs to be, you'll see that there's a "This Update" time which is the most recent time at which the responder (i.e. the party signing the OCSP response) knew the status to be correct, and a "Next Update" time which is the time at which newer information will be available. As long as the current time is between those two times, you can consider the response to be valid. Of course, it's always possible a newer (and different) response was created before that "Next Update" time, and the only way to know for sure is to make a live check to the OCSP server, but the general intent is that the window of time in the response should be sufficiently short that for most purposes you shouldn't need to worry about this.