'Initiate, or reply to, the shutdown handshake of the TLS layer.'

def _shutdownTLS(self):

    try:
        shutdownSuccess = self._tlsConnection.shutdown()
    except Error:
        shutdownSuccess = False
    self._flushSendBIO()
    if shutdownSuccess:
        self.transport.loseConnection()
