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

def close(self):

    if (self._makefile_refs < 1):
        self.__ssl_conn.shutdown()
    else:
        self._makefile_refs -= 1
