'Send closure alert
:return: True if the shutdown completed successfully (i.e. both sides
have sent closure alerts), false otherwise (i.e. you have to
wait for a ZeroReturnError on a recv() method call'

def shutdown(self):

    result = _lib.SSL_shutdown(self._ssl)
    if (result < 0):
        self._raise_ssl_error(self._ssl, result)
    elif (result > 0):
        return True
    else:
        return False
