in tls-table.py [0:0]
def get_colorize_chart():
# XXX: should prefer to use code points from IANA_URL
name_code_points = {}
try:
output = subprocess.check_output(['openssl', 'ciphers', '-V'], universal_newlines=True)
for line in output.split('\n'):
if '0x' in line:
fields = line.split()
name_code_points[fields[2]] = fields[0]
except:
print('Unable to run openssl ciphers', file=sys.stderr)
sys.exit()
print('Retrieving cipher suites from Mozilla Server Side TLS page', file=sys.stderr)
# Grab the cipher suites from the Mozilla page
r = requests.get(MOZILLA_SERVER_SIDE_TLS_URL)
# Try to grab the ciphersuites out the ugly mess that is a wiki page
# XXX: should prefer to use structured data from guidelines instead of from wiki page
recommendations = [];
for line in r.text.split('\n'):
if "* Cipher suites (" in line:
if "'''" in line:
recommendations.append(line.split("'''")[1])
else:
recommendations.append('')
__colorize_lists.update({
'Modern': get_colorize_chart_openssl_ciphers(name_code_points, recommendations[0] + ':' + recommendations[1]),
'Intermediate': get_colorize_chart_openssl_ciphers(name_code_points, recommendations[2] + ':' + recommendations[3]),
'Old': get_colorize_chart_openssl_ciphers(name_code_points, recommendations[4] + ':' + recommendations[5])
})