'Send a TLS close alert and close the underlying connection.'

def loseConnection(self):

    if self.disconnecting:
        return
    if ((not self._handshakeDone) and (not self._appSendBuffer)):
        self.abortConnection()
    self.disconnecting = True
    if ((not self._appSendBuffer) and (self._producer is None)):
        self._shutdownTLS()
