'Shutdown the SSL connection and call the close method of the
underlying socket'

def close(self):

    if (self._makefile_refs < 1):
        try:
            self.__ssl_conn.shutdown()
        except (SSL.Error, SSL.SysCallError):
            pass
    else:
        self._makefile_refs -= 1
