feat: add infrastructure audit and diagnostic helper scripts
This commit is contained in:
23
scripts/check_wan_certs.py
Normal file
23
scripts/check_wan_certs.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import socket
|
||||
import ssl
|
||||
|
||||
def check_cert(domain, ip="174.106.252.96"):
|
||||
print(f"=== Checking SSL for {domain} at {ip}:443 ===")
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = True
|
||||
try:
|
||||
with socket.create_connection((ip, 443), timeout=5) as sock:
|
||||
with ctx.wrap_socket(sock, server_hostname=domain) as ssock:
|
||||
cert = ssock.getpeercert()
|
||||
print("Cert Subject:", cert.get('subject'))
|
||||
print("SAN:", cert.get('subjectAltName'))
|
||||
print("Cipher:", ssock.cipher())
|
||||
print("ALPN:", ssock.selected_alpn_protocol())
|
||||
except Exception as e:
|
||||
print("SSL Error:", e)
|
||||
|
||||
check_cert('pihole1.snarfnet.net')
|
||||
check_cert('pihole2.snarfnet.net')
|
||||
check_cert('dns1.snarfnet.net')
|
||||
check_cert('dns2.snarfnet.net')
|
||||
|
||||
Reference in New Issue
Block a user