Skip Menu |

This queue is for tickets about the Crypt-SSLeay CPAN distribution.

Report information
The Basics
Id: 28432
Status: resolved
Priority: 2/
Queue: Crypt-SSLeay

People
Owner: nanis [...] runu.moc.invalid
Requestors: info [...] gknw.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.56
Fixed in:
  • 0.57_01
  • 0.57_02



Subject: Crypt-SSLeay-0.56 small fix for NetWare platform
Date: Mon, 23 Jul 2007 15:13:57 +0200
To: bug-Crypt-SSLeay [...] rt.cpan.org
From: Guenter Knauf <info [...] gknw.de>
Hi David, the NetWare Perl implementation lacks of alarm() too: --- SSL.pm.orig Sat May 19 16:58:02 2007 +++ SSL.pm Mon Jul 23 15:09:12 2007 @@ -25,6 +25,7 @@ sub _alarm_set { return if $^O eq 'MSWin32'; + return if $^O eq 'NetWare'; alarm(shift); } thanks, Guenter. BTW. better you wait a little bit with next release since I'm just in testmode....., hehe.... Anyway thanks for your hyperfast reply!
Subject: Crypt-SSLeay-0.56 build issues on Win32 platform
Date: Mon, 23 Jul 2007 20:26:28 +0200
To: bug-Crypt-SSLeay [...] rt.cpan.org
From: Guenter Knauf <info [...] gknw.de>
Hi David, while testing the Win32 MSVC / ActivePerl build I found another serious problem; when I try a https connection via LWP I get: Free to wrong pool 223f30 not 30c01a0 at C:/Perl/site/lib/LWP/Protocol/https.pm line 34. this happens because of a wrong define for CRYPT_SSLEAY_free; the detection of version 0.9.6 and later fails because of line 221: if(($openssl_version =~ /^OpenSSL/) and ($openssl_version !~ /0\.9\.[2-5]/)) { the first test for ^OpenSSL always fails because $openssl_version contains only the dotted version number, and not the string 'OpenSSL'; therefore I simplyfied the line to: if($pkg_config->{ver} !~ /0\.9\.[2-5]/) { which works now fine...(I directly used $pkg_config->{ver}, and removed $openssl_version because its not further used). Finally I've now also added another option --nwtests=y|1 so that its possible to avoid that Makefile.PL stops for an input; this is important for automatic builds like ActiveState might do.... here's my new unified diff against Makefile.PL from Crypt-SSLeay-0.56 (also attached): --- Makefile.PL.orig Mon Jul 23 13:03:21 2007 +++ Makefile.PL Mon Jul 23 20:13:54 2007 @@ -9,11 +9,13 @@ eval "use ExtUtils::MakeMaker::Coverage"; $@ or print "Adding testcover target\n"; -use vars qw($opt_default $opt_libpath); +use vars qw($opt_default $opt_libpath $opt_static $opt_nwtests); GetOptions( - "default", \$opt_default, - "lib=s", \$opt_libpath, + "default", \$opt_default, + "lib=s", \$opt_libpath, + "static", \$opt_static, + "nwtests=s", \$opt_nwtests, ); $opt_default ||= $ENV{CRYPT_SSLEAY_DEFAULT}; @@ -139,12 +141,12 @@ # external tools probably expect \ and not / for path separators $SSL_DIR =~ tr{/}{\\}; - # default to drive C: - $SSL_DIR = "c:$SSL_DIR" if $SSL_DIR !~ /\A[a-z]:/i; + # default to drive C: if no relative path + $SSL_DIR = "c:$SSL_DIR" if ($SSL_DIR !~ /\A[a-z]:|^../i); my $inc = $pkg_config->{inc}; $inc =~ tr{/}{\\}; - $inc !~ /^[a-z]:/i and $inc = "c:$inc"; + $inc !~ /^[a-z]:|^../i and $inc = "c:$inc"; push @INC_FLAGS, "-I$inc"; push @INC_FLAGS, "-I$SSL_DIR\\inc32" if -d "$SSL_DIR/inc32"; @@ -157,10 +159,14 @@ elsif(-d "$SSL_DIR/lib") { push @LIB_FLAGS, "-L$SSL_DIR\\lib"; } - elsif(-d "$SSL_DIR/out32dll") { + elsif(-d "$SSL_DIR/out32dll" && !$opt_static) { # patch from Ben Laurie push @LIB_FLAGS, "-L$SSL_DIR\\out32dll"; } + elsif(-d "$SSL_DIR/out32" && $opt_static) { + # patch from Guenter Knauf + push @LIB_FLAGS, "-L$SSL_DIR\\out32"; + } else { # Allow developers to point at OpenSSL source... push @LIB_FLAGS, "-L$SSL_DIR"; @@ -217,8 +223,7 @@ } # OPENSSL_free defined in OpenSSL 0.9.6 and higher -my $openssl_version = $pkg_config->{ver}; -if(($openssl_version =~ /^OpenSSL/) and ($openssl_version !~ /0\.9\.[2-5]/)) { +if($pkg_config->{ver} !~ /0\.9\.[2-5]/) { print INCLUDE "#define CRYPT_SSLEAY_free OPENSSL_free\n"; } else { @@ -264,17 +269,20 @@ cc $Config{cc} INFO - print <<INFO; + if (!defined($opt_nwtests)) { + print <<INFO; The test suite can attempt to connect to public servers to ensure that the code is working properly. If you are behind a strict firewall or have no network connectivity, these tests may fail (through no fault of the code). INFO - my $network_tests = prompt - "Do you want to run the live tests (y/N) ?", - 'N'; - print OUT "network_tests ", ($network_tests =~ /y/i) ? 1 : 0, "\n"; + my $network_tests = prompt + "Do you want to run the live tests (y/N) ?", + 'N'; + $opt_nwtests = ($network_tests =~ /y/i) ? 1 : 0; + } + print OUT "network_tests ", ($opt_nwtests =~ /y|1/i) ? 1 : 0, "\n"; close OUT; } @@ -287,8 +295,8 @@ my $inc_dir; my $version_file; for ( - "$dir/crypto/opensslv.h", # cygwin32 builds "$dir/inc32/openssl/opensslv.h", # old win32 builds + "$dir/crypto/opensslv.h", # cygwin32 builds "$dir/include/openssl/opensslv.h", "$dir/include/opensslv.h", "$dir/include/crypto.h" for the moment I believe that I have no more improvements since all is working now fine for me; so feel free to make a release with this patch + #28432 ... thanks, Guenter.
--- Makefile.PL.orig Mon Jul 23 13:03:21 2007 +++ Makefile.PL Mon Jul 23 20:13:54 2007 @@ -9,11 +9,13 @@ eval "use ExtUtils::MakeMaker::Coverage"; $@ or print "Adding testcover target\n"; -use vars qw($opt_default $opt_libpath); +use vars qw($opt_default $opt_libpath $opt_static $opt_nwtests); GetOptions( - "default", \$opt_default, - "lib=s", \$opt_libpath, + "default", \$opt_default, + "lib=s", \$opt_libpath, + "static", \$opt_static, + "nwtests=s", \$opt_nwtests, ); $opt_default ||= $ENV{CRYPT_SSLEAY_DEFAULT}; @@ -139,12 +141,12 @@ # external tools probably expect \ and not / for path separators $SSL_DIR =~ tr{/}{\\}; - # default to drive C: - $SSL_DIR = "c:$SSL_DIR" if $SSL_DIR !~ /\A[a-z]:/i; + # default to drive C: if no relative path + $SSL_DIR = "c:$SSL_DIR" if ($SSL_DIR !~ /\A[a-z]:|^../i); my $inc = $pkg_config->{inc}; $inc =~ tr{/}{\\}; - $inc !~ /^[a-z]:/i and $inc = "c:$inc"; + $inc !~ /^[a-z]:|^../i and $inc = "c:$inc"; push @INC_FLAGS, "-I$inc"; push @INC_FLAGS, "-I$SSL_DIR\\inc32" if -d "$SSL_DIR/inc32"; @@ -157,10 +159,14 @@ elsif(-d "$SSL_DIR/lib") { push @LIB_FLAGS, "-L$SSL_DIR\\lib"; } - elsif(-d "$SSL_DIR/out32dll") { + elsif(-d "$SSL_DIR/out32dll" && !$opt_static) { # patch from Ben Laurie push @LIB_FLAGS, "-L$SSL_DIR\\out32dll"; } + elsif(-d "$SSL_DIR/out32" && $opt_static) { + # patch from Guenter Knauf + push @LIB_FLAGS, "-L$SSL_DIR\\out32"; + } else { # Allow developers to point at OpenSSL source... push @LIB_FLAGS, "-L$SSL_DIR"; @@ -217,8 +223,7 @@ } # OPENSSL_free defined in OpenSSL 0.9.6 and higher -my $openssl_version = $pkg_config->{ver}; -if(($openssl_version =~ /^OpenSSL/) and ($openssl_version !~ /0\.9\.[2-5]/)) { +if($pkg_config->{ver} !~ /0\.9\.[2-5]/) { print INCLUDE "#define CRYPT_SSLEAY_free OPENSSL_free\n"; } else { @@ -264,17 +269,20 @@ cc $Config{cc} INFO - print <<INFO; + if (!defined($opt_nwtests)) { + print <<INFO; The test suite can attempt to connect to public servers to ensure that the code is working properly. If you are behind a strict firewall or have no network connectivity, these tests may fail (through no fault of the code). INFO - my $network_tests = prompt - "Do you want to run the live tests (y/N) ?", - 'N'; - print OUT "network_tests ", ($network_tests =~ /y/i) ? 1 : 0, "\n"; + my $network_tests = prompt + "Do you want to run the live tests (y/N) ?", + 'N'; + $opt_nwtests = ($network_tests =~ /y/i) ? 1 : 0; + } + print OUT "network_tests ", ($opt_nwtests =~ /y|1/i) ? 1 : 0, "\n"; close OUT; } @@ -287,8 +295,8 @@ my $inc_dir; my $version_file; for ( - "$dir/crypto/opensslv.h", # cygwin32 builds "$dir/inc32/openssl/opensslv.h", # old win32 builds + "$dir/crypto/opensslv.h", # cygwin32 builds "$dir/include/openssl/opensslv.h", "$dir/include/opensslv.h", "$dir/include/crypto.h"
On Mon Jul 23 14:26:14 2007, info@gknw.de wrote: Show quoted text
> Hi David,
Hi Guenter, thanks for your work. I'm looking at this patch right now. Show quoted text
> while testing the Win32 MSVC / ActivePerl build I found another > serious problem; > when I try a https connection via LWP I get: > Free to wrong pool 223f30 not 30c01a0 at > C:/Perl/site/lib/LWP/Protocol/https.pm line 34.
erk. Show quoted text
> this happens because of a wrong define for CRYPT_SSLEAY_free; > the detection of version 0.9.6 and later fails because of line 221: > if(($openssl_version =~ /^OpenSSL/) and ($openssl_version !~ > /0\.9\.[2-5]/)) { > the first test for ^OpenSSL always fails because $openssl_version > contains only the dotted version number, and not the string 'OpenSSL'; > therefore I simplyfied the line to: > if($pkg_config->{ver} !~ /0\.9\.[2-5]/) { > which works now fine...(I directly used $pkg_config->{ver}, and > removed $openssl_version because its not further used).
Right. I think this must have always been there, or else I messed things up in a refactoring a while back. I have taken your idea and expanded it, in order to take account the possibility of the libssleay library being used, and also future-proofing the test so that it doesn't stop working if OpenSSL v1.0 is ever released. Show quoted text
> Finally I've now also added another option --nwtests=y|1 so that its > possible to avoid that Makefile.PL stops for an input; this is > important for automatic builds like ActiveState might do....
Thanks for the idea, but I won't include this in the distribution. The correct way of dealing with this is to say set PERL_USE_MM_DEFAULT=1 perl Makefile.PL This is documented in the README and the POD. Show quoted text
> here's my new unified diff against Makefile.PL from Crypt-SSLeay-0.56 > (also attached):
[...] Show quoted text
> @@ -287,8 +295,8 @@ > my $inc_dir; > my $version_file; > for ( > - "$dir/crypto/opensslv.h", # cygwin32 builds > "$dir/inc32/openssl/opensslv.h", # old win32 builds > + "$dir/crypto/opensslv.h", # cygwin32 builds > "$dir/include/openssl/opensslv.h", > "$dir/include/opensslv.h", > "$dir/include/crypto.h"
I have included this change. Thanks, David
Guenter, you can look at http://svnweb.mongueurs.net/Crypt-SSLeay/browse/trunk?lang=en to see the latest version of Makefile.PL in the repository. Best, David
Subject: Re: [rt.cpan.org #28432] Crypt-SSLeay-0.56 small fix for NetWare platform
Date: Tue, 31 Jul 2007 14:25:32 +0200
To: bug-Crypt-SSLeay [...] rt.cpan.org
From: Guenter Knauf <info [...] gknw.de>
Hi David, Show quoted text
>> Finally I've now also added another option --nwtests=y|1 so that its >> possible to avoid that Makefile.PL stops for an input; this is >> important for automatic builds like ActiveState might do....
Show quoted text
> Thanks for the idea, but I won't include this in the distribution. The > correct way of dealing with this is to say
Show quoted text
> set PERL_USE_MM_DEFAULT=1 > perl Makefile.PL
Show quoted text
> This is documented in the README and the POD.
but that's not the same: this only assumes the 'default answer' to all questions; my hack instead can specify if you want the tests or not. In addition I've tested this option, and at least with my ActivePerl it doesnt seem to work at all. Guenter.
On Tue Jul 31 08:25:17 2007, info@gknw.de wrote: Show quoted text
> Hi David,
> >> Finally I've now also added another option --nwtests=y|1 so that
> its
> >> possible to avoid that Makefile.PL stops for an input; this is > >> important for automatic builds like ActiveState might do....
>
> > Thanks for the idea, but I won't include this in the distribution.
> The
> > correct way of dealing with this is to say
>
> > set PERL_USE_MM_DEFAULT=1 > > perl Makefile.PL
>
> > This is documented in the README and the POD.
> but that's not the same: this only assumes the 'default answer' to all > questions; > my hack instead can specify if you want the tests or not. > > In addition I've tested this option, and at least with my ActivePerl > it doesnt seem to work at all.
Ah, good point. I had not thought things out completely. Thanks, David
On Tue Jul 31 09:51:08 2007, DLAND wrote: Show quoted text
> On Tue Jul 31 08:25:17 2007, info@gknw.de wrote:
> > Hi David,
> > >> Finally I've now also added another option --nwtests=y|1 so that
> > its
> > >> possible to avoid that Makefile.PL stops for an input; this is > > >> important for automatic builds like ActiveState might do....
> >
> > > Thanks for the idea, but I won't include this in the distribution.
> > The
> > > correct way of dealing with this is to say
> >
> > > set PERL_USE_MM_DEFAULT=1 > > > perl Makefile.PL
> >
> > > This is documented in the README and the POD.
> > but that's not the same: this only assumes the 'default answer' to all > > questions; > > my hack instead can specify if you want the tests or not. > > > > In addition I've tested this option, and at least with my ActivePerl > > it doesnt seem to work at all.
> > Ah, good point. I had not thought things out completely.
I released 0.57_01 and it contains a fix for this problem. 0.58 should be out in a week or so if no serious problems show up. Thanks, David
Hello: Thank you for your report and the fix. I am closing this as resolved as the fix was added in 0.57_01 and the OpenSSL version detection method was changed in 0.57_02. 0.57_04 is available at http://search.cpan.org/~nanis/Crypt-SSLeay-0.57_04/ I would appreciate it if you can give that a try and create a new ticket if you encounter any problems. -- Sinan On Mon Feb 18 15:57:01 2008, DLAND wrote: Show quoted text
> On Tue Jul 31 09:51:08 2007, DLAND wrote:
> > On Tue Jul 31 08:25:17 2007, info@gknw.de wrote:
> > > Hi David,
> > > >> Finally I've now also added another option --nwtests=y|1 so that
> > > its
> > > >> possible to avoid that Makefile.PL stops for an input; this is > > > >> important for automatic builds like ActiveState might do....
> > >
> > > > Thanks for the idea, but I won't include this in the distribution.
> > > The
> > > > correct way of dealing with this is to say
> > >
> > > > set PERL_USE_MM_DEFAULT=1 > > > > perl Makefile.PL
> > >
> > > > This is documented in the README and the POD.
> > > but that's not the same: this only assumes the 'default answer' to all > > > questions; > > > my hack instead can specify if you want the tests or not. > > > > > > In addition I've tested this option, and at least with my ActivePerl > > > it doesnt seem to work at all.
> > > > Ah, good point. I had not thought things out completely.
> > I released 0.57_01 and it contains a fix for this problem. 0.58 should > be out in a week or so if no serious problems show up. > > Thanks, > David >