OLD | NEW |
1 """ | 1 """ |
2 A helper class for using TLS Lite with stdlib clients | 2 A helper class for using TLS Lite with stdlib clients |
3 (httplib, xmlrpclib, imaplib, poplib). | 3 (httplib, xmlrpclib, imaplib, poplib). |
4 """ | 4 """ |
5 | 5 |
6 from tlslite.Checker import Checker | 6 from tlslite.checker import Checker |
7 | 7 |
8 class ClientHelper: | 8 class ClientHelper: |
9 """This is a helper class used to integrate TLS Lite with various | 9 """This is a helper class used to integrate TLS Lite with various |
10 TLS clients (e.g. poplib, smtplib, httplib, etc.)""" | 10 TLS clients (e.g. poplib, smtplib, httplib, etc.)""" |
11 | 11 |
12 def __init__(self, | 12 def __init__(self, |
13 username=None, password=None, sharedKey=None, | 13 username=None, password=None, sharedKey=None, |
14 certChain=None, privateKey=None, | 14 certChain=None, privateKey=None, |
15 cryptoID=None, protocol=None, | 15 cryptoID=None, protocol=None, |
16 x509Fingerprint=None, | 16 x509Fingerprint=None, |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 elif self.username and self.sharedKey: | 153 elif self.username and self.sharedKey: |
154 tlsConnection.handshakeClientSharedKey(username=self.username, | 154 tlsConnection.handshakeClientSharedKey(username=self.username, |
155 sharedKey=self.sharedKey, | 155 sharedKey=self.sharedKey, |
156 settings=self.settings) | 156 settings=self.settings) |
157 else: | 157 else: |
158 tlsConnection.handshakeClientCert(certChain=self.certChain, | 158 tlsConnection.handshakeClientCert(certChain=self.certChain, |
159 privateKey=self.privateKey, | 159 privateKey=self.privateKey, |
160 checker=self.checker, | 160 checker=self.checker, |
161 settings=self.settings, | 161 settings=self.settings, |
162 session=self.tlsSession) | 162 session=self.tlsSession) |
163 self.tlsSession = tlsConnection.session | 163 self.tlsSession = tlsConnection.session |
OLD | NEW |