MCPcopy
hub / github.com/tornadoweb/tornado / test_start_tls_smtp

Method test_start_tls_smtp

tornado/test/iostream_test.py:1047–1065  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1045
1046 @gen_test
1047 def test_start_tls_smtp(self):
1048 # This flow is simplified from RFC 3207 section 5.
1049 # We don't really need all of this, but it helps to make sure
1050 # that after realistic back-and-forth traffic the buffers end up
1051 # in a sane state.
1052 yield self.server_send_line(b"220 mail.example.com ready\r\n")
1053 yield self.client_send_line(b"EHLO mail.example.com\r\n")
1054 yield self.server_send_line(b"250-mail.example.com welcome\r\n")
1055 yield self.server_send_line(b"250 STARTTLS\r\n")
1056 yield self.client_send_line(b"STARTTLS\r\n")
1057 yield self.server_send_line(b"220 Go ahead\r\n")
1058 client_future = self.client_start_tls(dict(cert_reqs=ssl.CERT_NONE))
1059 server_future = self.server_start_tls(_server_ssl_options())
1060 self.client_stream = yield client_future
1061 self.server_stream = yield server_future
1062 self.assertTrue(isinstance(self.client_stream, SSLIOStream))
1063 self.assertTrue(isinstance(self.server_stream, SSLIOStream))
1064 yield self.client_send_line(b"EHLO mail.example.com\r\n")
1065 yield self.server_send_line(b"250 mail.example.com welcome\r\n")
1066
1067 @gen_test
1068 def test_handshake_fail(self):

Callers

nothing calls this directly

Calls 5

server_send_lineMethod · 0.95
client_send_lineMethod · 0.95
client_start_tlsMethod · 0.95
server_start_tlsMethod · 0.95
_server_ssl_optionsFunction · 0.85

Tested by

no test coverage detected