… | |
… | |
227 | This will not work for partial TLS data that could not yet been |
227 | This will not work for partial TLS data that could not yet been |
228 | encoded. This data will be lost. |
228 | encoded. This data will be lost. |
229 | |
229 | |
230 | =item tls => "accept" | "connect" | Net::SSLeay::SSL object |
230 | =item tls => "accept" | "connect" | Net::SSLeay::SSL object |
231 | |
231 | |
232 | When this parameter is given, it enables TLS (SSL) mode, that means it |
232 | When this parameter is given, it enables TLS (SSL) mode, that means |
233 | will start making tls handshake and will transparently encrypt/decrypt |
233 | AnyEvent will start a TLS handshake and will transparently encrypt/decrypt |
234 | data. |
234 | data. |
235 | |
235 | |
236 | TLS mode requires Net::SSLeay to be installed (it will be loaded |
236 | TLS mode requires Net::SSLeay to be installed (it will be loaded |
237 | automatically when you try to create a TLS handle). |
237 | automatically when you try to create a TLS handle). |
238 | |
238 | |
239 | For the TLS server side, use C<accept>, and for the TLS client side of a |
239 | Unlike TCP, TLS has a server and client side: for the TLS server side, use |
240 | connection, use C<connect> mode. |
240 | C<accept>, and for the TLS client side of a connection, use C<connect> |
|
|
241 | mode. |
241 | |
242 | |
242 | You can also provide your own TLS connection object, but you have |
243 | You can also provide your own TLS connection object, but you have |
243 | to make sure that you call either C<Net::SSLeay::set_connect_state> |
244 | to make sure that you call either C<Net::SSLeay::set_connect_state> |
244 | or C<Net::SSLeay::set_accept_state> on it before you pass it to |
245 | or C<Net::SSLeay::set_accept_state> on it before you pass it to |
245 | AnyEvent::Handle. |
246 | AnyEvent::Handle. |
246 | |
247 | |
247 | See the C<starttls> method if you need to start TLS negotiation later. |
248 | See the C<starttls> method for when need to start TLS negotiation later. |
248 | |
249 | |
249 | =item tls_ctx => $ssl_ctx |
250 | =item tls_ctx => $ssl_ctx |
250 | |
251 | |
251 | Use the given Net::SSLeay::CTX object to create the new TLS connection |
252 | Use the given Net::SSLeay::CTX object to create the new TLS connection |
252 | (unless a connection object was specified directly). If this parameter is |
253 | (unless a connection object was specified directly). If this parameter is |