| OLD | NEW |
| 1 """TLS Lite + smtplib.""" | 1 """TLS Lite + smtplib.""" |
| 2 | 2 |
| 3 from smtplib import SMTP | 3 from smtplib import SMTP |
| 4 from tlslite.TLSConnection import TLSConnection | 4 from tlslite.tlsconnection import TLSConnection |
| 5 from tlslite.integration.ClientHelper import ClientHelper | 5 from tlslite.integration.clienthelper import ClientHelper |
| 6 | 6 |
| 7 class SMTP_TLS(SMTP): | 7 class SMTP_TLS(SMTP): |
| 8 """This class extends L{smtplib.SMTP} with TLS support.""" | 8 """This class extends L{smtplib.SMTP} with TLS support.""" |
| 9 | 9 |
| 10 def starttls(self, | 10 def starttls(self, |
| 11 username=None, password=None, sharedKey=None, | 11 username=None, password=None, sharedKey=None, |
| 12 certChain=None, privateKey=None, | 12 certChain=None, privateKey=None, |
| 13 cryptoID=None, protocol=None, | 13 cryptoID=None, protocol=None, |
| 14 x509Fingerprint=None, | 14 x509Fingerprint=None, |
| 15 x509TrustList=None, x509CommonName=None, | 15 x509TrustList=None, x509CommonName=None, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 certChain, privateKey, | 104 certChain, privateKey, |
| 105 cryptoID, protocol, | 105 cryptoID, protocol, |
| 106 x509Fingerprint, | 106 x509Fingerprint, |
| 107 x509TrustList, x509CommonName, | 107 x509TrustList, x509CommonName, |
| 108 settings) | 108 settings) |
| 109 conn = TLSConnection(self.sock) | 109 conn = TLSConnection(self.sock) |
| 110 conn.closeSocket = True | 110 conn.closeSocket = True |
| 111 helper._handshake(conn) | 111 helper._handshake(conn) |
| 112 self.sock = conn | 112 self.sock = conn |
| 113 self.file = conn.makefile('rb') | 113 self.file = conn.makefile('rb') |
| 114 return (resp, reply) | 114 return (resp, reply) |
| OLD | NEW |