Fix bug with no DVSNI challenges

This commit is contained in:
James Kasten
2015-03-24 17:49:38 -07:00
parent 57bb4513c3
commit a1fe6039d8
+14 -14
View File
@@ -50,7 +50,7 @@ class ApacheDvsni(object):
def perform(self): def perform(self):
"""Peform a DVSNI challenge.""" """Peform a DVSNI challenge."""
if not self.achalls: if not self.achalls:
return None return []
# Save any changes to the configuration as a precaution # Save any changes to the configuration as a precaution
# About to make temporary changes to the config # About to make temporary changes to the config
self.configurator.save() self.configurator.save()
@@ -160,19 +160,19 @@ class ApacheDvsni(object):
ips = " ".join(str(i) for i in ip_addrs) ips = " ".join(str(i) for i in ip_addrs)
document_root = os.path.join( document_root = os.path.join(
self.configurator.config.config_dir, "dvsni_page/") self.configurator.config.config_dir, "dvsni_page/")
return ("<VirtualHost " + ips + ">\n" return ("<VirtualHost " + ips + ">{0}"
"ServerName " + achall.nonce_domain + "\n" "ServerName " + achall.nonce_domain + "{0}"
"UseCanonicalName on\n" "UseCanonicalName on{0}"
"SSLStrictSNIVHostCheck on\n" "SSLStrictSNIVHostCheck on{0}"
"\n" "{0}"
"LimitRequestBody 1048576\n" "LimitRequestBody 1048576{0}"
"\n" "{0}"
"Include " + self.configurator.parser.loc["ssl_options"] + "\n" "Include " + self.configurator.parser.loc["ssl_options"] + "{0}"
"SSLCertificateFile " + self.get_cert_file(achall) + "\n" "SSLCertificateFile " + self.get_cert_file(achall) + "{0}"
"SSLCertificateKeyFile " + achall.key.file + "\n" "SSLCertificateKeyFile " + achall.key.file + "{0}"
"\n" "{0}"
"DocumentRoot " + document_root + "\n" "DocumentRoot " + document_root + "{0}"
"</VirtualHost>\n\n") "</VirtualHost>{0}{0}".format(os.linesep))
def get_cert_file(self, achall): def get_cert_file(self, achall):
"""Returns standardized name for challenge certificate. """Returns standardized name for challenge certificate.