Codebase list libnet-sslglue-perl / 26dea14
Merge tag 'upstream/1.057' Upstream version 1.057 Salvatore Bonaccorso 7 years ago
7 changed file(s) with 42 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
0 1.057 2016/04/04
1 - removed warning with very old versions of LWP where
2 LWP::Protocol::https::VERSION was not defined yet.
3 Thanks to denis[AT]fateyev[DOT]com for reporting
4
5 1.056 2015/10/31
6 - fix another memory leak which happened on data connections only
7 - make sure that context reuse is done properly, see
8 https://github.com/noxxi/p5-net-sslglue/pull/3
9
010 1.055 2015/10/25
111 - fix memory leak in Net::SSLGlue::Socket, RT#107816.
212 Thanks to kasyap.mr[AT]gmail[DOT]com for reporting
4141 "url" : "https://github.com/noxxi/p5-net-sslglue"
4242 }
4343 },
44 "version" : "1.055"
44 "version" : "1.057"
4545 }
2020 IO::Socket::SSL: 1.19
2121 resources:
2222 repository: https://github.com/noxxi/p5-net-sslglue
23 version: 1.055
23 version: 1.057
00 use strict;
11 use warnings;
22 package Net::SSLGlue::LWP;
3 our $VERSION = 0.5;
3 our $VERSION = 0.501;
44 use LWP::UserAgent '5.822';
55 use IO::Socket::SSL 1.19;
66 use URI;
1010 my $use_existent;
1111 BEGIN {
1212 require LWP::Protocol::https;
13 $use_existent = $LWP::Protocol::https::VERSION >= 6.06
13 $use_existent = $LWP::Protocol::https::VERSION
14 && $LWP::Protocol::https::VERSION >= 6.06
1415 && $LWP::UserAgent::VERSION >= 6.06;
1516 if ($use_existent) {
1617 my $oc = $Net::HTTPS::SSL_SOCKET_CLASS ||
4141 tie *{$self}, "Net::SSLGlue::Socket::HANDLE", $self;
4242
4343 return $self;
44 }
45
46 sub DESTROY {
47 my $self = shift;
48 %{*$self} = ();
4449 }
4550
4651 for my $sub (qw(
8085 };
8186
8287 sub start_SSL {
83 my $self = shift;
88 my ($self,%args) = @_;
8489 croak("start_SSL called on SSL socket") if ${*$self}{ssl};
85 IO::Socket::SSL->start_SSL(${*$self}{sock},%{${*$self}{sslargs}},@_)
86 or return;
90
91 %args = (%{${*$self}{sslargs}},%args);
92 if (my $ctx = $args{SSL_reuse_ctx}) {
93 # take the context from the attached socket
94 $args{SSL_reuse_ctx} = ${*$ctx}{sock}
95 if $ctx->isa('Net::SSLGlue::Socket');
96 }
97 IO::Socket::SSL->start_SSL(${*$self}{sock},%args) or return;
8798 ${*$self}{ssl} = 1;
8899 return $self;
89100 }
164175 $plain->stop_SSL
165176
166177
167 =head1 DESCRIPTIONA
178 =head1 DESCRIPTION
168179
169180 First, it is recommended to use L<IO::Socket::SSL> directly instead of this
170181 module, since this kind of functionality is available in IO::Socket::SSL since
00 package Net::SSLGlue;
1 our $VERSION = '1.055';
1 our $VERSION = '1.057';
22
33 =head1 NAME
44
1717 use IO::Socket::SSL;
1818 use File::Temp;
1919
20 # first try to connect w/o ftp
21 # plain
22 diag( "connect inet to $server:21" );
23 IO::Socket::INET->new( "$server:21" ) or do {
24 plan skip_all => "$server:21 not reachable";
25 };
20 # check if we can connect and log in at all (plain)
21 diag( "connect ftp w/o ssl to $server" );
22 my $ftp;
23 if ( $ftp = Net::FTP->new($server, Debug => $debug)
24 and $ftp->login("anonymous",'net-sslglue-ftp@test.perl')) {
25 diag( "connect ftp w/o ssl to $server works" );
26 } else {
27 plan skip_all => "no connect/login w/o ssl possible";
28 }
29
2630
2731 # ssl to the right host
2832 diag( "connect inet to $server:990" );
5054
5155 # first direct SSL
5256 diag( "connect ftp over ssl to $server" );
53 my $ftp = Net::FTP->new($server,
57 $ftp = Net::FTP->new($server,
5458 SSL => 1,
5559 %sslargs,
5660 Debug => $debug,