mirror of
https://github.com/certbot/certbot.git
synced 2026-06-06 15:22:38 -04:00
Further (and different, and better) standardisation
This commit is contained in:
parent
182e9b29e4
commit
3712a45399
3 changed files with 8 additions and 8 deletions
|
|
@ -47,7 +47,7 @@ class Config:
|
|||
self.timestamp = parse_timestamp(val)
|
||||
elif atr == "expires":
|
||||
self.expires = parse_timestamp(val)
|
||||
elif atr == "security-policies":
|
||||
elif atr == "tls-policies":
|
||||
self.tls_policies = {}
|
||||
for domain,policies in self.check_tls_policy_domains(val):
|
||||
if type(policies) != dict:
|
||||
|
|
@ -67,18 +67,18 @@ class Config:
|
|||
|
||||
def check_tls_policy_domains(self, val):
|
||||
if type(val) != dict:
|
||||
raise TypeError, "security-policies should be a dict" + `val`
|
||||
raise TypeError, "tls-policies should be a dict" + `val`
|
||||
for domain, policies in val.items():
|
||||
try:
|
||||
assert type(domain) == unicode
|
||||
d = str(domain) # convert from unicode
|
||||
except:
|
||||
raise TypeError, "security-policy domain not a string" + `domain`
|
||||
raise TypeError, "tls-policy domain not a string" + `domain`
|
||||
if not d.startswith("*."):
|
||||
raise ValueError, "security-policy domains must start with *.; try *."+d
|
||||
raise ValueError, "tls-policy domains must start with *.; try *."+d
|
||||
d = d.partition("*.")[2]
|
||||
if not looks_like_a_domain(d):
|
||||
raise ValueError, "security-policy for something that a domain? " + d
|
||||
raise ValueError, "tls-policy for something that a domain? " + d
|
||||
yield (d, policies)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ The basic file format will be JSON with comments (http://blog.getify.com/json-co
|
|||
// "timestamp": 1401414363, : also acceptable
|
||||
"author": "Electronic Frontier Foundation https://eff.org",
|
||||
"expires": "2014-06-06T14:30:16+00:00",
|
||||
"security-policies": {
|
||||
"tls-policies": {
|
||||
// These match on the MX domain.
|
||||
"*.yahoodns.net": {
|
||||
"require-valid-certificate": true,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"mx-domains": {
|
||||
"tls-policies": {
|
||||
"*.mx.aol.com": {
|
||||
"min-tls-version": "TLSv1",
|
||||
"require-tls": true
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
"require-tls": true
|
||||
}
|
||||
},
|
||||
"address-domains": {
|
||||
"acceptable-mxs": {
|
||||
"wp.pl": {
|
||||
"accept-mx-domains": [
|
||||
"*.wp.pl"
|
||||
|
|
|
|||
Loading…
Reference in a new issue