Last active 1696958755

This is the script that checks SSL for the IRC servers in the teapot.chat network, but can be adapted easily.

gistfile1.txt Raw
1#!/bin/python3
2import os,subprocess,re
3def emit(msg):
4 print(f" {msg}")
5
6servers = ["cardamom","coffee","earlgrey"]
7network = "teapot.chat"
8ssl_port = 6697
9print("Here's the report:")
10print("Servers:")
11for server in servers:
12 sp = subprocess.run(["/usr/bin/openssl","s_client","-connect",f"{server}.{network}:{str(ssl_port)}"], capture_output=True, text=True, input="QUIT :quit")#timeout=10)
13 result = re.search("Verify return code: .*", sp.stdout).group()
14 emit(f"{server} - {result}")