jmjl revised this gist . 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