OLD | NEW |
1 """TLS Lite + poplib.""" | 1 """TLS Lite + poplib.""" |
2 | 2 |
3 import socket | 3 import socket |
4 from poplib import POP3 | 4 from poplib import POP3 |
5 from tlslite.TLSConnection import TLSConnection | 5 from tlslite.tlsconnection import TLSConnection |
6 from tlslite.integration.ClientHelper import ClientHelper | 6 from tlslite.integration.clienthelper import ClientHelper |
7 | 7 |
8 # POP TLS PORT | 8 # POP TLS PORT |
9 POP3_TLS_PORT = 995 | 9 POP3_TLS_PORT = 995 |
10 | 10 |
11 class POP3_TLS(POP3, ClientHelper): | 11 class POP3_TLS(POP3, ClientHelper): |
12 """This class extends L{poplib.POP3} with TLS support.""" | 12 """This class extends L{poplib.POP3} with TLS support.""" |
13 | 13 |
14 def __init__(self, host, port = POP3_TLS_PORT, | 14 def __init__(self, host, port = POP3_TLS_PORT, |
15 username=None, password=None, sharedKey=None, | 15 username=None, password=None, sharedKey=None, |
16 certChain=None, privateKey=None, | 16 certChain=None, privateKey=None, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 x509TrustList, x509CommonName, | 132 x509TrustList, x509CommonName, |
133 settings) | 133 settings) |
134 | 134 |
135 self.sock = TLSConnection(self.sock) | 135 self.sock = TLSConnection(self.sock) |
136 self.sock.closeSocket = True | 136 self.sock.closeSocket = True |
137 ClientHelper._handshake(self, self.sock) | 137 ClientHelper._handshake(self, self.sock) |
138 ### | 138 ### |
139 | 139 |
140 self.file = self.sock.makefile('rb') | 140 self.file = self.sock.makefile('rb') |
141 self._debugging = 0 | 141 self._debugging = 0 |
142 self.welcome = self._getresp() | 142 self.welcome = self._getresp() |
OLD | NEW |