fork(1) download
  1. import re
  2.  
  3. entries = ['SSLv2 not offered (OK)', 'SSLv3 not offered (OK)', 'TLS 1 not offered', 'TLS 1.1 not offered', 'TLS 1.2 offered (OK)', 'TLS 1.3 not offered and downgraded to a weaker protocol', 'NPN/SPDY h2, http/1.1 (advertised)', 'ALPN/HTTP2 h2, http/1.1 (offered)']
  4. for entry in entries:
  5. print( dict(re.findall(r'^(\S+(?:\s+\d+(?:\.\d+)*)?)\s+(.*)', entry.strip())) )
Success #stdin #stdout 0.02s 9404KB
stdin
Standard input is empty
stdout
{'SSLv2': 'not offered (OK)'}
{'SSLv3': 'not offered (OK)'}
{'TLS 1': 'not offered'}
{'TLS 1.1': 'not offered'}
{'TLS 1.2': 'offered (OK)'}
{'TLS 1.3': 'not offered and downgraded to a weaker protocol'}
{'NPN/SPDY': 'h2, http/1.1 (advertised)'}
{'ALPN/HTTP2': 'h2, http/1.1 (offered)'}