Initial import to Tizen
[profile/ivi/python-twisted.git] / twisted / internet / _ssl.py
1 # -*- test-case-name: twisted.test.test_ssl -*-
2 # Copyright (c) Twisted Matrix Laboratories.
3 # See LICENSE for details.
4
5 """
6 This module implements helpers for switching to TLS on an existing transport.
7
8 @since: 11.1
9 """
10
11 class _TLSDelayed(object):
12     """
13     State tracking record for TLS startup parameters.  Used to remember how
14     TLS should be started when starting it is delayed to wait for the output
15     buffer to be flushed.
16
17     @ivar bufferedData: A C{list} which contains all the data which was
18         written to the transport after an attempt to start TLS was made but
19         before the buffers outstanding at that time could be flushed and TLS
20         could really be started.  This is appended to by the transport's
21         write and writeSequence methods until it is possible to actually
22         start TLS, then it is written to the TLS-enabled transport.
23
24     @ivar context: An SSL context factory object to use to start TLS.
25
26     @ivar extra: An extra argument to pass to the transport's C{startTLS}
27         method.
28     """
29     def __init__(self, bufferedData, context, extra):
30         self.bufferedData = bufferedData
31         self.context = context
32         self.extra = extra