diff options
Diffstat (limited to 'test/netlib/tools/getcertnames')
-rw-r--r-- | test/netlib/tools/getcertnames | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/test/netlib/tools/getcertnames b/test/netlib/tools/getcertnames deleted file mode 100644 index 0882fccd..00000000 --- a/test/netlib/tools/getcertnames +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python -import sys -sys.path.insert(0, "../../") -from netlib import tcp - - -def get_remote_cert(host, port, sni): - c = tcp.TCPClient((host, port)) - c.connect() - c.convert_to_ssl(sni=sni) - return c.cert - -if len(sys.argv) > 2: - port = int(sys.argv[2]) -else: - port = 443 -if len(sys.argv) > 3: - sni = sys.argv[3] -else: - sni = None - -cert = get_remote_cert(sys.argv[1], port, sni) -print("CN:", cert.cn) -if cert.altnames: - print("SANs:") - for i in cert.altnames: - print("\t", i) |