[New-bugs-announce] [issue25569] Memory leak in SSLSocket.getpeercert()

Alex Gaynor report at bugs.python.org
Fri Nov 6 15:08:01 EST 2015

New submission from Alex Gaynor:

Run the following code:

import socket
import ssl
import sys

def main():
    ctx = ssl.create_default_context()
    s = socket.create_connection(('www.bing.com', 443))
    s = ctx.wrap_socket(s, server_hostname='www.bing.com')
    while True:


if __name__ == '__main__':

and observe memory usage, you'll see it increases by a MB/s or so.

messages: 254210
nosy: alex
priority: normal
severity: normal
status: open
title: Memory leak in SSLSocket.getpeercert()
versions: Python 2.7, Python 3.5, Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list