/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to server.py

Added support for protocol version handling

Show diffs side-by-side

added added

removed removed

Lines of Context:
433
433
    def handle(self):
434
434
        logger.debug(u"TCP connection from: %s",
435
435
                     unicode(self.client_address))
 
436
 
 
437
        line = self.socket.makefile().readline()
 
438
        try:
 
439
            if int(line.strip().split()[0]) > 1:
 
440
                raise RuntimeError
 
441
        except (ValueError, IndexError, RuntimeError), error:
 
442
            logger.error(u"Unknown protocol version: %s", error)
 
443
            return
 
444
        
436
445
        session = gnutls.connection.ClientSession\
437
446
                  (self.request, gnutls.connection.X509Credentials())
438
447
        # Note: gnutls.connection.X509Credentials is really a generic