| 396 | return exit_status |
| 397 | |
| 398 | def build_ciphers_lists(): |
| 399 | sstlsurl = "https://statics.tls.security.mozilla.org/server-side-tls-conf.json" |
| 400 | conf = dict() |
| 401 | try: |
| 402 | raw = urlopen(sstlsurl).read() |
| 403 | conf = json.loads(raw) |
| 404 | logging.debug('retrieving online server side tls recommendations from %s' % sstlsurl) |
| 405 | except URLError: |
| 406 | with open('server-side-tls-conf.json', 'r') as f: |
| 407 | conf = json.load(f) |
| 408 | logging.debug('Error connecting to %s; using local archive of server side tls recommendations' % sstlsurl) |
| 409 | except: |
| 410 | print("failed to retrieve JSON configurations from %s" % sstlsurl) |
| 411 | sys.exit(23) |
| 412 | |
| 413 | global old, inter, modern |
| 414 | old = conf["configurations"]["old"] |
| 415 | inter = conf["configurations"]["intermediate"] |
| 416 | modern = conf["configurations"]["modern"] |
| 417 | |
| 418 | def main(): |
| 419 | parser = argparse.ArgumentParser( |