blob: c4f7d8893c8a89bbcaeeff81f9fe0aaa8ad13d29 [file] [log] [blame]
Jean-Paul Calderone897bc252008-02-18 20:50:23 -05001<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html>
3<head>
4<title>3.3.2 Connection objects </title>
5<META NAME="description" CONTENT="3.3.2 Connection objects ">
6<META NAME="keywords" CONTENT="pyOpenSSL">
7<META NAME="resource-type" CONTENT="document">
8<META NAME="distribution" CONTENT="global">
9<link rel="STYLESHEET" href="pyOpenSSL.css">
10<LINK REL="previous" href="openssl-context.html">
11<LINK REL="up" href="openssl-ssl.html">
12<LINK REL="next" href="internals.html">
13</head>
14<body>
15<DIV CLASS="navigation">
16<table align="center" width="100%" cellpadding="0" cellspacing="2">
17<tr>
18<td><A href="openssl-context.html"><img src="previous.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050019 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050020 alt="Previous Page" width="32"></A></td>
21<td><A href="openssl-ssl.html"><img src="up.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050022 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050023 alt="Up One Level" width="32"></A></td>
24<td><A href="internals.html"><img src="next.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050025 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050026 alt="Next Page" width="32"></A></td>
27<td align="center" width="100%">Python OpenSSL Manual</td>
28<td><A href="contents.html"><img src="contents.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -050029 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050030 alt="Contents" width="32"></A></td>
31<td><img src="blank.gif"
32 border="0" height="32"
33 alt="" width="32"></td>
34<td><img src="blank.gif"
35 border="0" height="32"
36 alt="" width="32"></td>
37</tr></table>
38<b class="navlabel">Previous:</b> <a class="sectref" href="openssl-context.html">3.3.1 Context objects</A>
39<b class="navlabel">Up:</b> <a class="sectref" href="openssl-ssl.html">3.3 SSL </A>
40<b class="navlabel">Next:</b> <a class="sectref" href="internals.html">4 Internals</A>
41<br><hr>
42</DIV>
43<!--End of Navigation Panel-->
44
45<H3><A NAME="SECTION000432000000000000000">&nbsp;</A>
46<BR>
473.3.2 Connection objects
48</H3>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050049
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050050<P>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050051Connection objects have the following methods:
52
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050053<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -040054<dl><dt><b><a name='l2h-188'><tt class='method'>accept</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050055<dd>
56Call the <tt class="method">accept</tt> method of the underlying socket and set up SSL on the
57returned socket, using the Context object supplied to this Connection object at
58creation. Returns a pair <code>(<var>conn</var>, <var>address</var>)</code>. where <var>conn</var>
59is the new Connection object created, and <var>address</var> is as returned by the
60socket's <tt class="method">accept</tt>.
61</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050062
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050063<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -040064<dl><dt><b><a name='l2h-189'><tt class='method'>bind</tt></a></b>(<var>address</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050065<dd>
66Call the <tt class="method">bind</tt> method of the underlying socket.
67</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050068
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050069<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -040070<dl><dt><b><a name='l2h-190'><tt class='method'>close</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050071<dd>
72Call the <tt class="method">close</tt> method of the underlying socket. Note: If you want
73correct SSL closure, you need to call the <tt class="method">shutdown</tt> method first.
74</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050075
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050076<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -040077<dl><dt><b><a name='l2h-191'><tt class='method'>connect</tt></a></b>(<var>address</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050078<dd>
79Call the <tt class="method">connect</tt> method of the underlying socket and set up SSL on the
80socket, using the Context object supplied to this Connection object at
81creation.
82</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050083
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050084<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -040085<dl><dt><b><a name='l2h-192'><tt class='method'>connect_ex</tt></a></b>(<var>address</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050086<dd>
87Call the <tt class="method">connect_ex</tt> method of the underlying socket and set up SSL on
88the socket, using the Context object supplied to this Connection object at
89creation. Note that if the <tt class="method">connect_ex</tt> method of the socket doesn't
90return 0, SSL won't be initialized.
91</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -050092
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050093<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -040094<dl><dt><b><a name='l2h-193'><tt class='method'>do_handshake</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -050095<dd>
96Perform an SSL handshake (usually called after <tt class="method">renegotiate</tt> or one of
97<tt class="method">set_accept_state</tt> or <tt class="method">set_accept_state</tt>). This can raise the
98same exceptions as <tt class="method">send</tt> and <tt class="method">recv</tt>.
99</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500100
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500101<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400102<dl><dt><b><a name='l2h-194'><tt class='method'>fileno</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500103<dd>
104Retrieve the file descriptor number for the underlying socket.
105</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500106
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500107<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400108<dl><dt><b><a name='l2h-195'><tt class='method'>listen</tt></a></b>(<var>backlog</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500109<dd>
110Call the <tt class="method">listen</tt> method of the underlying socket.
111</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500112
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500113<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400114<dl><dt><b><a name='l2h-196'><tt class='method'>get_app_data</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500115<dd>
116Retrieve application data as set by <tt class="method">set_app_data</tt>.
117</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500118
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500119<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400120<dl><dt><b><a name='l2h-197'><tt class='method'>get_cipher_list</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500121<dd>
122Retrieve the list of ciphers used by the Connection object. WARNING: This API
123has changed. It used to take an optional parameter and just return a string,
124but not it returns the entire list in one go.
125</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500126
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500127<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400128<dl><dt><b><a name='l2h-198'><tt class='method'>get_client_ca_list</tt></a></b>()
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500129<dd>
130Retrieve the list of preferred client certificate issuers sent by the server
131as <tt class="class">OpenSSL.crypto.X509Name</tt> objects.
132
133<P>
134If this is a client <tt class="class">Connection</tt>, the list will be empty until the
135connection with the server is established.
136
137<P>
138If this is a server <tt class="class">Connection</tt>, return the list of certificate
139authorities that will be sent or has been sent to the client, as controlled
140by this <tt class="class">Connection</tt>'s <tt class="class">Context</tt>.
141
142<P>
143
144<span class='versionnote'>New in version 0.10.</span>
145
146</dl>
147
148<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400149<dl><dt><b><a name='l2h-199'><tt class='method'>get_context</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500150<dd>
151Retrieve the Context object associated with this Connection.
152</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500153
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500154<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400155<dl><dt><b><a name='l2h-200'><tt class='method'>set_context</tt></a></b>(<var>context</var>)
156<dd>
157Specify a replacement Context object for this Connection.
158</dl>
159
160<P>
161<dl><dt><b><a name='l2h-201'><tt class='method'>get_peer_certificate</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500162<dd>
163Retrieve the other side's certificate (if any)
164</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500165
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500166<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400167<dl><dt><b><a name='l2h-202'><tt class='method'>get_peer_cert_chain</tt></a></b>()
168<dd>
169Retrieve the tuple of the other side's certificate chain (if any)
170</dl>
171
172<P>
173<dl><dt><b><a name='l2h-203'><tt class='method'>getpeername</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500174<dd>
175Call the <tt class="method">getpeername</tt> method of the underlying socket.
176</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500177
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500178<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400179<dl><dt><b><a name='l2h-204'><tt class='method'>getsockname</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500180<dd>
181Call the <tt class="method">getsockname</tt> method of the underlying socket.
182</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500183
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500184<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400185<dl><dt><b><a name='l2h-205'><tt class='method'>getsockopt</tt></a></b>(<var>level, optname</var><big>[</big><var>, buflen</var><big>]</big>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500186<dd>
187Call the <tt class="method">getsockopt</tt> method of the underlying socket.
188</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500189
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500190<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400191<dl><dt><b><a name='l2h-206'><tt class='method'>pending</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500192<dd>
Jean-Paul Calderoneb6f57be2008-03-06 21:22:16 -0500193Retrieve the number of bytes that can be safely read from the SSL buffer
194(<i>not</i> the underlying transport buffer).
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500195</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500196
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500197<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400198<dl><dt><b><a name='l2h-207'><tt class='method'>recv</tt></a></b>(<var>bufsize</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500199<dd>
200Receive data from the Connection. The return value is a string representing the
201data received. The maximum amount of data to be received at once, is specified
202by <var>bufsize</var>.
203</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500204
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500205<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400206<dl><dt><b><a name='l2h-208'><tt class='method'>bio_write</tt></a></b>(<var>bytes</var>)
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500207<dd>
208If the Connection was created with a memory BIO, this method can be used to add
209bytes to the read end of that memory BIO. The Connection can then read the
210bytes (for example, in response to a call to <tt class="method">recv</tt>).
211</dl>
212
213<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400214<dl><dt><b><a name='l2h-209'><tt class='method'>renegotiate</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500215<dd>
216Renegotiate the SSL session. Call this if you wish to change cipher suites or
217anything like that.
218</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500219
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500220<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400221<dl><dt><b><a name='l2h-210'><tt class='method'>send</tt></a></b>(<var>string</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500222<dd>
223Send the <var>string</var> data to the Connection.
224</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500225
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500226<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400227<dl><dt><b><a name='l2h-211'><tt class='method'>bio_read</tt></a></b>(<var>bufsize</var>)
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500228<dd>
229If the Connection was created with a memory BIO, this method can be used to
230read bytes from the write end of that memory BIO. Many Connection methods will
231add bytes which must be read in this manner or the buffer will eventually fill
232up and the Connection will be able to take no further actions.
233</dl>
234
235<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400236<dl><dt><b><a name='l2h-212'><tt class='method'>sendall</tt></a></b>(<var>string</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500237<dd>
238Send all of the <var>string</var> data to the Connection. This calls <tt class="method">send</tt>
239repeatedly until all data is sent. If an error occurs, it's impossible to tell
240how much data has been sent.
241</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500242
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500243<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400244<dl><dt><b><a name='l2h-213'><tt class='method'>set_accept_state</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500245<dd>
246Set the connection to work in server mode. The handshake will be handled
247automatically by read/write.
248</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500249
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500250<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400251<dl><dt><b><a name='l2h-214'><tt class='method'>set_app_data</tt></a></b>(<var>data</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500252<dd>
253Associate <var>data</var> with this Connection object. <var>data</var> can be retrieved
254later using the <tt class="method">get_app_data</tt> method.
255</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500256
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500257<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400258<dl><dt><b><a name='l2h-215'><tt class='method'>set_connect_state</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500259<dd>
260Set the connection to work in client mode. The handshake will be handled
261automatically by read/write.
262</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500263
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500264<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400265<dl><dt><b><a name='l2h-216'><tt class='method'>setblocking</tt></a></b>(<var>flag</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500266<dd>
267Call the <tt class="method">setblocking</tt> method of the underlying socket.
268</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500269
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500270<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400271<dl><dt><b><a name='l2h-217'><tt class='method'>setsockopt</tt></a></b>(<var>level, optname, value</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500272<dd>
273Call the <tt class="method">setsockopt</tt> method of the underlying socket.
274</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500275
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500276<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400277<dl><dt><b><a name='l2h-218'><tt class='method'>shutdown</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500278<dd>
279Send the shutdown message to the Connection. Returns true if the shutdown
280message exchange is completed and false otherwise (in which case you call
281<tt class="method">recv()</tt> or <tt class="method">send()</tt> when the connection becomes
282readable/writeable.
283</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500284
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500285<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400286<dl><dt><b><a name='l2h-219'><tt class='method'>get_shutdown</tt></a></b>()
Jean-Paul Calderone72b8f0f2008-02-21 23:57:40 -0500287<dd>
288Get the shutdown state of the Connection. Returns a bitvector of either or
289both of <var>SENT_SHUTDOWN</var> and <var>RECEIVED_SHUTDOWN</var>.
290</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500291
Jean-Paul Calderone72b8f0f2008-02-21 23:57:40 -0500292<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400293<dl><dt><b><a name='l2h-220'><tt class='method'>set_shutdown</tt></a></b>(<var>state</var>)
Jean-Paul Calderone72b8f0f2008-02-21 23:57:40 -0500294<dd>
295Set the shutdown state of the Connection. <var>state</var> is a bitvector of
296either or both of <var>SENT_SHUTDOWN</var> and <var>RECEIVED_SHUTDOWN</var>.
297</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500298
Jean-Paul Calderone72b8f0f2008-02-21 23:57:40 -0500299<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400300<dl><dt><b><a name='l2h-221'><tt class='method'>sock_shutdown</tt></a></b>(<var>how</var>)
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500301<dd>
302Call the <tt class="method">shutdown</tt> method of the underlying socket.
303</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500304
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500305<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400306<dl><dt><b><a name='l2h-222'><tt class='method'>bio_shutdown</tt></a></b>()
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500307<dd>
308If the Connection was created with a memory BIO, this method can be used to
309indicate that ``end of file'' has been reached on the read end of that memory
310BIO.
311</dl>
312
313<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400314<dl><dt><b><a name='l2h-223'><tt class='method'>state_string</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500315<dd>
316Retrieve a verbose string detailing the state of the Connection.
317</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500318
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500319<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400320<dl><dt><b><a name='l2h-224'><tt class='method'>client_random</tt></a></b>()
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500321<dd>
322Retrieve the random value used with the client hello message.
323</dl>
324
325<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400326<dl><dt><b><a name='l2h-225'><tt class='method'>server_random</tt></a></b>()
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500327<dd>
328Retrieve the random value used with the server hello message.
329</dl>
330
331<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400332<dl><dt><b><a name='l2h-226'><tt class='method'>master_key</tt></a></b>()
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500333<dd>
334Retrieve the value of the master key for this session.
335</dl>
336
337<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400338<dl><dt><b><a name='l2h-227'><tt class='method'>want_read</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500339<dd>
340Checks if more data has to be read from the transport layer to complete an
341operation.
342</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500343
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500344<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400345<dl><dt><b><a name='l2h-228'><tt class='method'>want_write</tt></a></b>()
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500346<dd>
347Checks if there is data to write to the transport layer to complete an
348operation.
349</dl>
Jean-Paul Calderone2aa2b332008-03-06 21:43:14 -0500350
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500351<P>
Jean-Paul Calderone7fd9c562011-08-14 18:19:17 -0400352<dl><dt><b><a name='l2h-229'><tt class='method'>set_tlsext_host_name</tt></a></b>(<var>name</var>)
353<dd>
354Specify the byte string to send as the server name in the client hello message.
355
356<span class='versionnote'>New in version 0.13.</span>
357
358</dl>
359
360<P>
361<dl><dt><b><a name='l2h-230'><tt class='method'>get_servername</tt></a></b>()
362<dd>
363Get the value of the server name received in the client hello message.
364
365<span class='versionnote'>New in version 0.13.</span>
366
367</dl>
368
369<P>
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500370
371<DIV CLASS="navigation">
372<p><hr>
373<table align="center" width="100%" cellpadding="0" cellspacing="2">
374<tr>
375<td><A href="openssl-context.html"><img src="previous.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500376 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500377 alt="Previous Page" width="32"></A></td>
378<td><A href="openssl-ssl.html"><img src="up.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500379 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500380 alt="Up One Level" width="32"></A></td>
381<td><A href="internals.html"><img src="next.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500382 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500383 alt="Next Page" width="32"></A></td>
384<td align="center" width="100%">Python OpenSSL Manual</td>
385<td><A href="contents.html"><img src="contents.gif"
Jean-Paul Calderone215d51b2009-11-13 09:19:21 -0500386 border="0" height="32"
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500387 alt="Contents" width="32"></A></td>
388<td><img src="blank.gif"
389 border="0" height="32"
390 alt="" width="32"></td>
391<td><img src="blank.gif"
392 border="0" height="32"
393 alt="" width="32"></td>
394</tr></table>
395<b class="navlabel">Previous:</b> <a class="sectref" href="openssl-context.html">3.3.1 Context objects</A>
396<b class="navlabel">Up:</b> <a class="sectref" href="openssl-ssl.html">3.3 SSL </A>
397<b class="navlabel">Next:</b> <a class="sectref" href="internals.html">4 Internals</A>
398<hr>
Jean-Paul Calderoneb557e982011-09-02 11:35:12 -0400399<span class="release-info">Release 0.13.</span>
Jean-Paul Calderone897bc252008-02-18 20:50:23 -0500400</DIV>
401<!--End of Navigation Panel-->
402
403</BODY>
404</HTML>