Skip to content

Commit

Permalink
updated IO::Socket::SSL requirement to 1.43 due to bugs in older vers…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
kraih committed May 11, 2011
1 parent bb45f6f commit 56d17b1
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,10 @@ This file documents the revision history for Perl extension Mojolicious.

1.32 2011-05-08 00:00:00
- Added EXPERIMENTAL name support for template exceptions.
- Updated IO::Socket::SSL requirement to 1.43 due to bugs in older
versions.
Note that the version requirement will keep getting updated until
we encounter a version that is not broken most of the time.
- Improved reloading slightly by allowing it to clean up the main
namespace.
- Improved documentation.
Expand Down
22 changes: 13 additions & 9 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -61,7 +61,7 @@ use constant KQUEUE_WRITE => KQUEUE ? IO::KQueue::EVFILT_WRITE() : 0;
# TLS support requires IO::Socket::SSL
use constant TLS => $ENV{MOJO_NO_TLS}
? 0
: eval 'use IO::Socket::SSL 1.37 "inet4"; 1';
: eval 'use IO::Socket::SSL 1.43 "inet4"; 1';
use constant TLS_READ => TLS ? IO::Socket::SSL::SSL_WANT_READ() : 0;
use constant TLS_WRITE => TLS ? IO::Socket::SSL::SSL_WANT_WRITE() : 0;

Expand Down Expand Up @@ -315,7 +315,7 @@ sub listen {
$self = $self->singleton unless ref $self;
my $args = ref $_[0] ? $_[0] : {@_};

croak "IO::Socket::SSL 1.37 required for TLS support"
croak "IO::Socket::SSL 1.43 required for TLS support"
if $args->{tls} && !TLS;

my %options = (
Expand Down Expand Up @@ -727,19 +727,23 @@ sub start_tls {

# No TLS support
unless (TLS) {
$self->_error($id, 'IO::Socket::SSL 1.37 required for TLS support.');
$self->_error($id, 'IO::Socket::SSL 1.43 required for TLS support.');
return;
}

my $args = ref $_[0] ? $_[0] : {@_};
weaken $self;
my %options = (
SSL_startHandshake => 0,
SSL_error_trap => sub { $self->_error($id, $_[1]) },
SSL_cert_file => $args->{tls_cert},
SSL_key_file => $args->{tls_key},
SSL_verify_mode => 0x00,
Timeout => $self->connect_timeout,
SSL_startHandshake => 0,
SSL_error_trap => sub { $self->_error($id, $_[1]) },
SSL_cert_file => $args->{tls_cert},
SSL_key_file => $args->{tls_key},
SSL_verify_mode => 0x00,
SSL_create_ctx_callback => sub {
my $ctx = shift;
Net::SSLeay::CTX_sess_set_cache_size($ctx, 128);
},
Timeout => $self->connect_timeout,
%{$args->{tls_args} || {}}
);

Expand Down
2 changes: 1 addition & 1 deletion t/mojo/ioloop_tls.t
Expand Up @@ -30,7 +30,7 @@ use Test::More;
use Mojo::IOLoop;
plan skip_all => 'set TEST_TLS to enable this test (developer only!)'
unless $ENV{TEST_TLS};
plan skip_all => 'IO::Socket::SSL 1.37 required for this test!'
plan skip_all => 'IO::Socket::SSL 1.43 required for this test!'
unless Mojo::IOLoop::TLS;
plan skip_all => 'Windows is too fragile for this test!'
if Mojo::IOLoop::WINDOWS;
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/user_agent_tls.t
Expand Up @@ -10,7 +10,7 @@ use Test::More;
use Mojo::IOLoop;
plan skip_all => 'set TEST_TLS to enable this test (developer only!)'
unless $ENV{TEST_TLS};
plan skip_all => 'IO::Socket::SSL 1.37 required for this test!'
plan skip_all => 'IO::Socket::SSL 1.43 required for this test!'
unless Mojo::IOLoop::TLS;
plan tests => 14;

Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/tls_lite_app.t
Expand Up @@ -10,7 +10,7 @@ use Test::More;
use Mojo::IOLoop;
plan skip_all => 'set TEST_TLS to enable this test (developer only!)'
unless $ENV{TEST_TLS};
plan skip_all => 'IO::Socket::SSL 1.37 required for this test!'
plan skip_all => 'IO::Socket::SSL 1.43 required for this test!'
unless Mojo::IOLoop::TLS;
plan skip_all => 'Windows is too fragile for this test!'
if Mojo::IOLoop::WINDOWS;
Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/websocket_tls_proxy_lite_app.t
Expand Up @@ -10,7 +10,7 @@ use Test::More;
use Mojo::IOLoop;
plan skip_all => 'set TEST_TLS to enable this test (developer only!)'
unless $ENV{TEST_TLS};
plan skip_all => 'IO::Socket::SSL 1.37 required for this test!'
plan skip_all => 'IO::Socket::SSL 1.43 required for this test!'
unless Mojo::IOLoop::TLS;
plan skip_all => 'Windows is too fragile for this test!'
if Mojo::IOLoop::WINDOWS;
Expand Down

0 comments on commit 56d17b1

Please sign in to comment.