… | |
… | |
1895 | accomodate protocol changes. |
1895 | accomodate protocol changes. |
1896 | |
1896 | |
1897 | This read type does not rely on L<AnyEvent::TLS> (and thus, not on |
1897 | This read type does not rely on L<AnyEvent::TLS> (and thus, not on |
1898 | L<Net::SSLeay>). |
1898 | L<Net::SSLeay>). |
1899 | |
1899 | |
1900 | =item tls_autostart => $tls[, $tls_ctx] |
1900 | =item tls_autostart => [$tls_ctx, ]$tls |
1901 | |
1901 | |
1902 | Tries to detect a valid SSL or TLS handshake. If one is detected, it tries |
1902 | Tries to detect a valid SSL or TLS handshake. If one is detected, it tries |
1903 | to start tls by calling C<starttls> with the given arguments. |
1903 | to start tls by calling C<starttls> with the given arguments. |
1904 | |
1904 | |
1905 | In practise, C<$tls> must be C<accept>, or a Net::SSLeay context that has |
1905 | In practise, C<$tls> must be C<accept>, or a Net::SSLeay context that has |
… | |
… | |
1909 | See C<tls_detect> above for more details. |
1909 | See C<tls_detect> above for more details. |
1910 | |
1910 | |
1911 | Example: give the client a chance to start TLS before accepting a text |
1911 | Example: give the client a chance to start TLS before accepting a text |
1912 | line. |
1912 | line. |
1913 | |
1913 | |
1914 | $hdl->push_read (tls_detect => "accept"); |
1914 | $hdl->push_read (tls_autostart => "accept"); |
1915 | $hdl->push_read (line => sub { |
1915 | $hdl->push_read (line => sub { |
1916 | print "received ", ($_[0]{tls} ? "encrypted" : "cleartext"), " <$_[1]>\n"; |
1916 | print "received ", ($_[0]{tls} ? "encrypted" : "cleartext"), " <$_[1]>\n"; |
1917 | }); |
1917 | }); |
1918 | |
1918 | |
1919 | =cut |
1919 | =cut |