- New upstream release 1.978 - Added public prefix checking to verification of wildcard certificates, e.g. accept *.foo.com but not *.co.uk; see documentation of SSL_verifycn_publicsuffix and IO::Socket::SSL::PublicSuffix - Fix publicsuffix for IDNA, more tests with various IDNA libs (CPAN RT#94424) - Reuse result of IDN lib detection from PublicSuffix.pm in SSL.pm - Add more checks to external/usable_ca.t; now it is enough that at least one of the hosts verifies against the built-in CA store - Add openssl and Net::SSLeay version to diagnostics in load test - Switch preferred IDN back-end from Net::LibIDN to URI::_idna as per upstream, falling back to Net::IDN::Encode on older distributions - Add fix from upstream git to support building with Test::More < 0.88
70 lines
1.8 KiB
Diff
70 lines
1.8 KiB
Diff
From f00f9c221fd7d92b715434b7d96b26b644c8398f Mon Sep 17 00:00:00 2001
|
|
From: Steffen Ullrich <Steffen_Ullrich@genua.de>
|
|
Date: Fri, 4 Apr 2014 17:55:49 +0200
|
|
Subject: [PATCH] t/public_suffix_lib* - run test even if IDN lib cannot be
|
|
loaded, but skip IDN tests - don't use done_testing to work with older
|
|
Test::More
|
|
|
|
---
|
|
t/public_suffix_lib.pl | 20 +++++++++++++-------
|
|
1 file changed, 13 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/t/public_suffix_lib.pl b/t/public_suffix_lib.pl
|
|
index 6e6e3c5..66bdfe4 100644
|
|
--- a/t/public_suffix_lib.pl
|
|
+++ b/t/public_suffix_lib.pl
|
|
@@ -5,17 +5,19 @@
|
|
|
|
my $ps;
|
|
sub run_with_lib {
|
|
+ my @idnlib = @_;
|
|
my %require = (
|
|
'URI::_idna' => 0,
|
|
'Net::LibIDN' => 0,
|
|
'Net::IDN::Encode' => 0,
|
|
- map { $_ => 1 } @_,
|
|
+ map { $_ => 1 } @idnlib,
|
|
);
|
|
|
|
my %block;
|
|
+ my $can_idn;
|
|
while ( my ($lib,$load) = each %require ) {
|
|
if ( $load ) {
|
|
- eval "require $lib" or plan skip_all => "cannot load $lib: $@";
|
|
+ $can_idn = eval "require $lib";
|
|
} else {
|
|
$lib =~s{::}{/}g;
|
|
$block{"$lib.pm"} = 1;
|
|
@@ -28,6 +30,8 @@ sub run_with_lib {
|
|
|
|
require IO::Socket::SSL::PublicSuffix;
|
|
|
|
+ plan tests => 83;
|
|
+
|
|
|
|
# all one-level, but co.uk two-level
|
|
$ps = IO::Socket::SSL::PublicSuffix->from_string("*\nco.uk");
|
|
@@ -172,12 +176,14 @@ sub run_with_lib {
|
|
is public_suffix('www.test.k12.ak.us'), 'k12.ak.us';
|
|
|
|
# Domains and gTLDs with characters outside the ASCII range:
|
|
- if ( $ps->can_idn ) {
|
|
- is public_suffix('test.敎育.hk'), '敎育.hk';
|
|
- is public_suffix('ਭਾਰਤ.ਭਾਰਤ'), 'ਭਾਰਤ';
|
|
+ SKIP: {
|
|
+ if ( $can_idn ) {
|
|
+ is public_suffix('test.敎育.hk'), '敎育.hk';
|
|
+ is public_suffix('ਭਾਰਤ.ਭਾਰਤ'), 'ਭਾਰਤ';
|
|
+ } else {
|
|
+ skip "no IDN support with @idnlib",2
|
|
+ }
|
|
}
|
|
-
|
|
- done_testing();
|
|
}
|
|
|
|
|
|
--
|
|
1.9.1
|
|
|