Skip to content

Commit

Permalink
improved Mojo::IOLoop::Server to reuse cipher list from IO::Socket::SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 25, 2014
1 parent bf57785 commit 5e24045
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,5 +1,6 @@

4.95 2014-04-21
4.95 2014-04-25
- Improved Mojo::IOLoop::Server to reuse cipher list from IO::Socket::SSL.

4.94 2014-04-20
- Added reverse_proxy attribute to Mojo::Server::Daemon.
Expand Down
13 changes: 5 additions & 8 deletions lib/Mojo/IOLoop/Server.pm
Expand Up @@ -89,18 +89,16 @@ sub listen {
return unless $args->{tls};
croak "IO::Socket::SSL 1.84 required for TLS support" unless TLS;

# Prioritize RC4 to mitigate BEAST attack
$self->{tls} = {
SSL_ca_file => $args->{tls_ca}
&& -T $args->{tls_ca} ? $args->{tls_ca} : undef,
my $tls = $self->{tls} = {
SSL_cert_file => $args->{tls_cert} || $CERT,
SSL_cipher_list => $args->{tls_ciphers}
// 'ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH',
SSL_honor_cipher_order => 1,
SSL_key_file => $args->{tls_key} || $KEY,
SSL_startHandshake => 0,
SSL_verify_mode => $args->{tls_verify} // $args->{tls_ca} ? 0x03 : 0x00
};
$tls->{SSL_ca_file} = $args->{tls_ca}
if $args->{tls_ca} && -T $args->{tls_ca};
$tls->{SSL_cipher_list} = $args->{tls_ciphers} if $args->{tls_ciphers};
}

sub start {
Expand Down Expand Up @@ -288,8 +286,7 @@ Path to the TLS cert file, defaults to a built-in test certificate.
tls_ciphers => 'AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH'
Cipher specification string, defaults to
C<ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH>.
Cipher specification string.
=item tls_key
Expand Down
3 changes: 1 addition & 2 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -373,8 +373,7 @@ Path to the TLS cert file, defaults to a built-in test certificate.
ciphers=AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH
Cipher specification string, defaults to
C<ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH>.
Cipher specification string.
=item key
Expand Down

0 comments on commit 5e24045

Please sign in to comment.