mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 08:08:00 +02:00
Update to latest config format.
This commit is contained in:
+5
-8
@@ -7,6 +7,7 @@ import socket
|
|||||||
import subprocess
|
import subprocess
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
import collections
|
||||||
|
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
from M2Crypto import X509
|
from M2Crypto import X509
|
||||||
@@ -152,12 +153,8 @@ if __name__ == '__main__':
|
|||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
print("Usage: CheckSTARTTLS.py list-of-domains.txt > output.json")
|
print("Usage: CheckSTARTTLS.py list-of-domains.txt > output.json")
|
||||||
|
|
||||||
config = {
|
config = collections.defaultdict(dict)
|
||||||
"address-domains": {
|
|
||||||
},
|
|
||||||
"mx-domains": {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for domain in open(sys.argv[1]).readlines():
|
for domain in open(sys.argv[1]).readlines():
|
||||||
domain = domain.strip()
|
domain = domain.strip()
|
||||||
if not os.path.exists(domain):
|
if not os.path.exists(domain):
|
||||||
@@ -168,10 +165,10 @@ if __name__ == '__main__':
|
|||||||
min_version = min_tls_version(domain)
|
min_version = min_tls_version(domain)
|
||||||
if suffix != "":
|
if suffix != "":
|
||||||
suffix_match = "." + suffix
|
suffix_match = "." + suffix
|
||||||
config["address-domains"][domain] = {
|
config["acceptable-mxs"][domain] = {
|
||||||
"accept-mx-domains": [suffix_match]
|
"accept-mx-domains": [suffix_match]
|
||||||
}
|
}
|
||||||
config["mx-domains"][suffix_match] = {
|
config["tls-policies"][suffix_match] = {
|
||||||
"require-tls": True,
|
"require-tls": True,
|
||||||
"min-tls-version": min_version
|
"min-tls-version": min_version
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user