Friday, May 19. 2017
The Problem with OCSP Stapling and Must Staple and why Certificate Revocation is still broken
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).
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).
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.
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.
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).
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).
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!
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!
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.
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.
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.
Tracked: Jul 20, 16:58