Last active 1696958755

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

jmjl's Avatar jmjl revised this gist 1696749947. Go to revision

1 file changed, 14 insertions

gistfile1.txt(file created)

@@ -0,0 +1,14 @@
1 + #!/bin/python3
2 + import os,subprocess,re
3 + def emit(msg):
4 + print(f" {msg}")
5 +
6 + servers = ["cardamom","coffee","earlgrey"]
7 + network = "teapot.chat"
8 + ssl_port = 6697
9 + print("Here's the report:")
10 + print("Servers:")
11 + for 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}")
Newer Older