예제 #1
0
파일: sslayer.py 프로젝트: KurSh/peach
    def __init__(self, host, port, version, cert, pkey, timeout=0.25):
        TcpListener.__init__(self, host, port, timeout)

        self.cert = cert
        self.pkey = pkey
        self.version = version

        try:
            with open(self.cert) as fd:
                cert_content = fd.read()
        except IOError:
            raise PeachException("Unable to open %s" % self.cert)

        x509 = tlslite.api.X509()
        x509.parse(cert_content)
        self.certChain = tlslite.api.X509CertChain([x509])

        try:
            with open(self.pkey) as fd:
                pkey_content = fd.read()
        except IOError:
            raise PeachException("Unable to open %s" % self.pkey)

        self.privateKey = tlslite.api.parsePEMKey(pkey_content, private=True)
예제 #2
0
    def __init__(self, host, port, version, cert, pkey, timeout=0.25):
        TcpListener.__init__(self, host, port, timeout)

        self.cert = cert
        self.pkey = pkey
        self.version = version

        try:
            with open(self.cert) as fd:
                cert_content = fd.read()
        except IOError:
            raise PeachException("Unable to open %s" % self.cert)

        x509 = tlslite.api.X509()
        x509.parse(cert_content)
        self.certChain = tlslite.api.X509CertChain([x509])

        try:
            with open(self.pkey) as fd:
                pkey_content = fd.read()
        except IOError:
            raise PeachException("Unable to open %s" % self.pkey)

        self.privateKey = tlslite.api.parsePEMKey(pkey_content, private=True)
예제 #3
0
파일: irc.py 프로젝트: zgq346712481/peach
 def __init__(self, host, port):
     TcpListener.__init__(self, host, port)
     self._accepted = False
예제 #4
0
파일: sslayer.py 프로젝트: KurSh/peach
    def __init__(self, host, port, cert, pkey, timeout=0.25):
        TcpListener.__init__(self, host, port, timeout)

        self.cert = cert
        self.pkey = pkey
예제 #5
0
    def __init__(self, host, port, cert, pkey, timeout=0.25):
        TcpListener.__init__(self, host, port, timeout)

        self.cert = cert
        self.pkey = pkey