Autoconfigure OCSP Stapling with --must-staple

This commit is contained in:
sagi
2016-05-25 20:03:45 +00:00
parent 230423e4e0
commit b3aeeefe20
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -398,6 +398,7 @@ class Client(object):
hsts = config.hsts if "ensure-http-header" in supported else False hsts = config.hsts if "ensure-http-header" in supported else False
uir = config.uir if "ensure-http-header" in supported else False uir = config.uir if "ensure-http-header" in supported else False
staple = config.staple if "staple-ocsp" in supported else False staple = config.staple if "staple-ocsp" in supported else False
must_staple = config.must_staple
if redirect is None: if redirect is None:
redirect = enhancements.ask("redirect") redirect = enhancements.ask("redirect")
@@ -411,11 +412,11 @@ class Client(object):
if uir: if uir:
self.apply_enhancement(domains, "ensure-http-header", self.apply_enhancement(domains, "ensure-http-header",
"Upgrade-Insecure-Requests") "Upgrade-Insecure-Requests")
if staple: if staple or must_staple:
self.apply_enhancement(domains, "staple-ocsp") self.apply_enhancement(domains, "staple-ocsp")
msg = ("We were unable to restart web server") msg = ("We were unable to restart web server")
if redirect or hsts or uir or staple: if redirect or hsts or uir or staple or must_staple:
with error_handler.ErrorHandler(self._rollback_and_restart, msg): with error_handler.ErrorHandler(self._rollback_and_restart, msg):
self.installer.restart() self.installer.restart()
+3 -3
View File
@@ -201,9 +201,9 @@ class IConfig(zope.interface.Interface):
"Email used for registration and recovery contact.") "Email used for registration and recovery contact.")
rsa_key_size = zope.interface.Attribute("Size of the RSA key.") rsa_key_size = zope.interface.Attribute("Size of the RSA key.")
must_staple = zope.interface.Attribute( must_staple = zope.interface.Attribute(
"Whether to request the OCSP Must Staple certificate extension. " "Adds the OCSP Must Staple extension to the certificate."
"Additional setup may be required after issuance. This does not " "Autoconfigures OCSP Stapling for supported setups "
"currently autoconfigure web servers for OCSP stapling. ") "(Apache version >= 2.3.3 ).")
config_dir = zope.interface.Attribute("Configuration directory.") config_dir = zope.interface.Attribute("Configuration directory.")
work_dir = zope.interface.Attribute("Working directory.") work_dir = zope.interface.Attribute("Working directory.")