Parcourir la source

add SSL transport support to Net::Stomp for STOMP-over-SSL communication

Ralf S. Engelschall il y a 16 ans
Parent
commit
70e8791704
2 fichiers modifiés avec 48 ajouts et 9 suppressions
  1. 47 8
      perl-net/perl-net.patch
  2. 1 1
      perl-net/perl-net.spec

+ 47 - 8
perl-net/perl-net.patch

@@ -1,6 +1,6 @@
 Index: Net-Packet-3.26/Makefile.PL
---- Net-Packet-3.26/Makefile.PL.orig	2006-12-16 16:26:26 +0100
-+++ Net-Packet-3.26/Makefile.PL	2008-01-01 22:05:18 +0100
+--- Net-Packet-3.26/Makefile.PL.orig	2008-04-19 18:41:49 +0200
++++ Net-Packet-3.26/Makefile.PL	2009-10-11 10:33:36 +0200
 @@ -14,7 +14,6 @@
        Net::Libdnet  => 0,
        Time::HiRes   => 0,
@@ -10,8 +10,8 @@ Index: Net-Packet-3.26/Makefile.PL
     },
     ABSTRACT_FROM => 'lib/Net/Packet.pm',
 Index: Net-Patricia-1.15/libpatricia/patricia.c
---- Net-Patricia-1.15/libpatricia/patricia.c.orig	2005-12-07 21:55:39 +0100
-+++ Net-Patricia-1.15/libpatricia/patricia.c	2008-01-01 22:05:18 +0100
+--- Net-Patricia-1.15/libpatricia/patricia.c.orig	2009-04-19 06:28:15 +0200
++++ Net-Patricia-1.15/libpatricia/patricia.c	2009-10-11 10:33:36 +0200
 @@ -38,24 +38,24 @@
  /* prefix_tochar
   * convert prefix information to bytes
@@ -120,8 +120,8 @@ Index: Net-Patricia-1.15/libpatricia/patricia.c
  
      assert (patricia);
 Index: Net-Patricia-1.15/libpatricia/patricia.h
---- Net-Patricia-1.15/libpatricia/patricia.h.orig	2005-12-07 21:54:52 +0100
-+++ Net-Patricia-1.15/libpatricia/patricia.h	2008-01-01 22:05:18 +0100
+--- Net-Patricia-1.15/libpatricia/patricia.h.orig	2009-04-19 06:28:15 +0200
++++ Net-Patricia-1.15/libpatricia/patricia.h	2009-10-11 10:33:36 +0200
 @@ -15,10 +15,10 @@
  #ifndef _PATRICIA_H
  #define _PATRICIA_H
@@ -175,7 +175,7 @@ Index: Net-Patricia-1.15/libpatricia/patricia.h
  
 Index: Net-Pcap-0.16/Makefile.PL
 --- Net-Pcap-0.16/Makefile.PL.orig	2007-12-24 00:06:15 +0100
-+++ Net-Pcap-0.16/Makefile.PL	2008-01-01 22:08:20 +0100
++++ Net-Pcap-0.16/Makefile.PL	2009-10-11 10:33:36 +0200
 @@ -23,7 +23,8 @@
  }
  else {
@@ -188,7 +188,7 @@ Index: Net-Pcap-0.16/Makefile.PL
  for my $arg (@ARGV) {
 Index: Net-Pcap-0.16/Pcap.xs
 --- Net-Pcap-0.16/Pcap.xs.orig	2008-01-01 05:22:22 +0100
-+++ Net-Pcap-0.16/Pcap.xs	2008-01-01 22:05:18 +0100
++++ Net-Pcap-0.16/Pcap.xs	2009-10-11 10:33:36 +0200
 @@ -33,7 +33,7 @@
  #define NEED_sv_2pv_nolen 1
  #include "ppport.h"
@@ -198,3 +198,42 @@ Index: Net-Pcap-0.16/Pcap.xs
  
  #ifdef _CYGWIN
  #include <Win32-Extensions.h>
+Index: Net-Stomp-0.34/lib/Net/Stomp.pm
+--- Net-Stomp-0.34/lib/Net/Stomp.pm.orig	2008-06-27 10:31:46 +0200
++++ Net-Stomp-0.34/lib/Net/Stomp.pm	2009-10-11 10:42:05 +0200
+@@ -11,11 +11,21 @@
+ sub new {
+     my $class  = shift;
+     my $self   = $class->SUPER::new(@_);
+-    my $socket = IO::Socket::INET->new(
++    my $socket;
++    my %sockopts = (
+         PeerAddr => $self->hostname,
+         PeerPort => $self->port,
+         Proto    => 'tcp'
+     );
++    if ($self->ssl) {
++        eval { use use IO::Socket::SSL; };
++        die "SSL transport required IO::Socket::SSL" if ($@);
++        %sockopts = (%sockopts, %{$self->ssl});
++        $socket = IO::Socket::SSL->new(%sockopts);
++    }
++    else {
++        $socket = IO::Socket::INET->new(%sockopts);
++    }
+     die "Error connecting to " . $self->hostname . ':' . $self->port . ": $!"
+         unless $socket;
+     binmode($socket);
+@@ -169,6 +179,12 @@
+ 
+   my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61613' } );
+ 
++If you want to use SSL transport, pass in a hash named "ssl" with optional extra 
++options for the IO::Socket::SSL constructor (see its documentation for all possible options).
++
++  my $stomp = Net::Stomp->new( { hostname => 'localhost', port => '61612',
++                               ssl => { SSL_cipher_list => 'ALL:!EXPORT' } } );
++
+ =head2 connect
+ 
+ This connects to the Stomp server. You must pass in a login and

+ 1 - 1
perl-net/perl-net.spec

@@ -67,7 +67,7 @@ Class:        BASE
 Group:        Perl
 License:      GPL/Artistic
 Version:      %{V_perl}
-Release:      20090919
+Release:      20091011
 
 #   package options
 %option       with_pcap   no