The Problem with OCSP Stapling and Must Staple and why Certificate Revocation is still broken

Hanno's Blog

Friday, May 19. 2017

The Problem with OCSP Stapling and Must Staple and why Certificate Revocation is still broken


Trackbacks

How I tricked Symantec with a Fake Private Key
Lately, some attention was drawn to a widespread problem with TLS certificates. Many people are accidentaly publishing their private keys. Sometimes they are released as part of applications, in Github repositories or with common filenames on web servers.
Weblog: Hanno's blog
Tracked: Jul 20, 16:58

Comments
Display comments as (Linear | Threaded)

The default SSLStaplingCache from the Mozilla Config Generator (with Apache 2.4.18) is:

SSLStaplingCache shmcb:/var/run/ocsp(128000)

https://mozilla.github.io/server-side-tls/ssl-config-generator/

Which I assume is 128000 seconds, or 1.48 days.

Assuming that an OCSP response can be longer than that (LetsEncrypt has given me one for 7 days), I can see why that number should be increased.

But in your example you have 128000000 (1,482 days), which seems to be a little excessive.

Is that correct, or would 1280000 (14.8 days) be more appropriate?

---

PS: Thanks for the article, I didn't realise that Apache would ReturnResponderErrors by default, and is why this option should be disabled for Firefox users (says he hoping that the whole process will be improved soon).
#1 Craig Francis (Homepage) on 2017-05-22 11:41 (Reply)
Hi,

So I may be wrong here, but my naive thinking was that this number is actually the size of the cache. However I tried to confirm this and I couldn't find anything in the docs explaining what this number means (which again confirms my impression that the apache docs on this are really poor).

This was a while ago, but I remember that I once had a problem where I had the impression not all stapling replies fitted into the cache. So I increased it to a much larger value.
#1.1 Hanno (Homepage) on 2017-05-22 13:04 (Reply)
Good point, I misread the Apache docs, it is the size (in bytes) of the cache:

https://github.com/omnigroup/Apache/blob/master/httpd/modules/cache/mod_socache_shmcb.c#L308

So I assume the size should be based on the number of websites your hosting... where the Mozilla recommendation of 128000 bytes would probably be enough for most (assuming they are configuring their own server, which will probably host less than 10 websites).
#1.1.1 Craig Francis (Homepage) on 2017-05-22 13:21 (Reply)
When OCSP stapling was enabled in Nginx I immediately tried it. It was kind of confusing (because you not only had to enable it, you also had to provide an additional certificate of the OCSP server and set a DNS resolver just for OCSP), and quite hard to test.

That was several years ago - I thought the implementation would improve at some point, but it never did. Having like 6 different configuration options which all need to be set correctly for OCSP to work and making it difficult to test made me deactivate it at some point again. Because every time I looked at the OCSP configuration I was confused what the options meant and if it actually worked, and every additional domain/certificate started the whole process again, so that it never became easy. It always was confusing and hard.

I really hope somebody invests in this at some point - enabling OCSP should be one option set to "enable", and then work reliably on every request / between server restarts. That would improve so much!
#2 iquito (Homepage) on 2017-06-01 00:22 (Reply)
It seems the simplest solution is to make "SSLStaplingReturnResponderErrors off" pass on previous valid responses when an error is recieved from the root ocsp server (but still pass on revocations of course), so I will post a bug report on that with apache.

There is of course a second issue which is that apache should not wait until the cache expiry before fetching a new response, it needs some form of intelligence where it will refresh its cache before it expires, but the first issue is by far the more urgent.

Your suggested config is actually very similar to what I have been running for a couple of years, I ave just added must-staple to a couple of domains but after reading your article I think I am likely to reverse the changes until apache implements a proper solution.
#3 Chris C on 2017-09-18 00:44 (Reply)

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

 
 

About

This blog is written by Hanno Böck. Unless noted otherwise, its content is licensed as CC0.

You can find my web page with links to my work as a journalist here.

I am also publishing a newsletter about climate change and decarbonization technologies.

The blog uses the free software Serendipity and is hosted at schokokeks.org.

Hanno on Mastodon | Contact / Imprint | Privacy / Datenschutz