|
NAMEMojo::IOLoop::TLS - Non-blocking TLS handshake SYNOPSIS use Mojo::IOLoop::TLS;
# Negotiate TLS
my $tls = Mojo::IOLoop::TLS->new($old_handle);
$tls->on(upgrade => sub ($tls, $new_handle) {...});
$tls->on(error => sub ($tls, $err) {...});
$tls->negotiate(server => 1, tls_version => 'TLSv1_2');
# Start reactor if necessary
$tls->reactor->start unless $tls->reactor->is_running;
DESCRIPTIONMojo::IOLoop::TLS negotiates TLS for Mojo::IOLoop. EVENTSMojo::IOLoop::TLS inherits all events from Mojo::EventEmitter and can emit the following new ones. upgrade $tls->on(upgrade => sub ($tls, $handle) {...});
Emitted once TLS has been negotiated. error $tls->on(error => sub ($tls, $err) {...});
Emitted if an error occurs during negotiation, fatal if unhandled. ATTRIBUTESMojo::IOLoop::TLS implements the following attributes. reactormy $reactor = $tls->reactor; $tls = $tls->reactor(Mojo::Reactor::Poll->new); Low-level event reactor, defaults to the "reactor" attribute value of the global Mojo::IOLoop singleton. Note that this attribute is weakened. METHODSMojo::IOLoop::TLS inherits all methods from Mojo::EventEmitter and implements the following new ones. can_tlsmy $bool = Mojo::IOLoop::TLS->can_tls; True if IO::Socket::SSL 2.009+ is installed and TLS support enabled. negotiate $tls->negotiate(server => 1, tls_version => 'TLSv1_2');
$tls->negotiate({server => 1, tls_version => 'TLSv1_2'});
Negotiate TLS. These options are currently available:
newmy $tls = Mojo::IOLoop::TLS->new($handle); Construct a new Mojo::IOLoop::Stream object. SEE ALSOMojolicious, Mojolicious::Guides, <https://mojolicious.org>.
|