Created
December 2, 2017 22:12
-
-
Save nabla-c0d3/02ffe4b6e34c5248a343f24af69ffcf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pympler import tracker | |
from nassl.ssl_client import OpenSslVersionEnum, OpenSslVerifyEnum | |
import socket | |
from nassl.legacy_ssl_client import LegacySslClient, SslClient | |
memory_tracker = tracker.SummaryTracker() | |
for i in range(20): | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.settimeout(5) | |
sock.connect(('www.google.com', 443)) | |
ssl_client = SslClient(ssl_version=OpenSslVersionEnum.TLSV1_2, underlying_socket=sock, | |
ssl_verify=OpenSslVerifyEnum.NONE) | |
ssl_client.do_handshake() | |
print(ssl_client.get_current_cipher_name()) | |
ssl_client.shutdown() | |
sock.close() | |
memory_tracker.print_diff() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment