From cbee3bdfa6b36aabf9b36412f8fa9b6b44371be7 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 6 Feb 2016 00:25:50 +0100 Subject: minor fixes --- MANIFEST.in | 1 + setup.cfg | 2 ++ setup.py | 2 +- test/tools/getcertnames | 27 +++++++++++++++++++++++++++ tools/getcertnames | 27 --------------------------- 5 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 setup.cfg create mode 100644 test/tools/getcertnames delete mode 100755 tools/getcertnames diff --git a/MANIFEST.in b/MANIFEST.in index a68c043e..db0e2ed6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include LICENSE CONTRIBUTORS README.rst graft test +prune test/tools recursive-exclude * *.pyc *.pyo *.swo *.swp \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..3480374b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 \ No newline at end of file diff --git a/setup.py b/setup.py index a3691ab9..bcaecad4 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ setup( "Topic :: Software Development :: Testing", "Topic :: Software Development :: Testing :: Traffic Generation", ], - packages=find_packages(), + packages=find_packages(exclude=["test", "test.*"]), include_package_data=True, zip_safe=False, install_requires=[ diff --git a/test/tools/getcertnames b/test/tools/getcertnames new file mode 100644 index 00000000..e33619f7 --- /dev/null +++ b/test/tools/getcertnames @@ -0,0 +1,27 @@ +#!/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 diff --git a/tools/getcertnames b/tools/getcertnames deleted file mode 100755 index e33619f7..00000000 --- a/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 -- cgit v1.2.3