コード例 #1
0
ファイル: Connection.py プロジェクト: hcastilho/M2Crypto
 def makefile(self, mode='rb', bufsize='ignored'):
     r = 'r' in mode or '+' in mode
     w = 'w' in mode or 'a' in mode or '+' in mode
     b = 'b' in mode
     m2mode = ['', 'r'][r] + ['', 'w'][w] + ['', 'b'][b]      
     # XXX Need to dup().
     bio = BIO.BIO(self.sslbio, _close_cb=self.close)
     m2.bio_do_handshake(bio._ptr())
     return BIO.IOBuffer(bio, m2mode, _pyfree=0)
コード例 #2
0
 def makefile(self, mode='rb', bufsize='ignored'):
     r = 'r' in mode or '+' in mode
     w = 'w' in mode or 'a' in mode or '+' in mode
     b = 'b' in mode
     m2mode = ['', 'r'][r] + ['', 'w'][w] + ['', 'b'][b]
     # XXX Need to dup().
     bio = BIO.BIO(self.sslbio, _close_cb=self.close)
     m2.bio_do_handshake(bio._ptr())
     return BIO.IOBuffer(bio, m2mode, _pyfree=0)
コード例 #3
0
    def do_handshake(self):
        # type: () -> int
        """Do the handshake.

        Return 1 if the handshake completes
        Return 0 or a negative number if there is a problem
        """
        return m2.bio_do_handshake(self.bio)
コード例 #4
0
ファイル: BIO.py プロジェクト: rodrigc/m2crypto
    def do_handshake(self):
        """
        Do the handshake.

        Return 1 if the handshake completes
        Return 0 or a negative number if there is a problem
        """
        return m2.bio_do_handshake(self.bio)