IO-Socket-SSL
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
# check if we have something which handles IDN
if ( ! eval { require Net::IDN::Encode } and ! eval { require Net::LibIDN } and ! eval { require URI; URI->VERSION(1.50) }) {
warn <<'EOM';
WARNING
No library for handling international domain names found.
It will work but croak if you try to verify an international name against
a certificate.
It's recommended to install URI version>=1.50.
Net::IDN::Encode and Net::LibIDN are also still supported.
EOM
}
# check if we have usable CA store
# on windows we might need to install Mozilla::CA
# settings for default path from openssl crypto/cryptlib.h
my %usable_ca;
{
my $openssldir = eval {
require Net::SSLeay;
Net::SSLeay::SSLeay_version(Net::SSLeay::SSLEAY_DIR()) =~m{^OPENSSLDIR: "(.+)"$} && $1 || '';
} || eval {
require Net::SSLeay;
Net::SSLeay::SSLeay_version(5) =~m{^OPENSSLDIR: "(.+)"$} && $1 || '';
};
my $dir = $ENV{SSL_CERT_DIR}
|| ( $^O =~m{vms}i ? "SSLCERTS:":"$openssldir/certs" );
if ( opendir(my $dh,$dir)) {
FILES: for my $f ( grep { m{^[a-f\d]{8}(\.\d+)?$} } readdir($dh) ) {
open( my $fh,'<',"$dir/$f") or next;
while (<$fh>) {
m{^-+BEGIN (X509 |TRUSTED |)CERTIFICATE-} or next;
$usable_ca{SSL_ca_path} = $dir;
last FILES;
}
}
}
my $file = $ENV{SSL_CERT_FILE}
|| ( $^O =~m{vms}i ? "SSLCERTS:cert.pem":"$openssldir/cert.pem" );
if ( open(my $fh,'<',$file)) {
while (<$fh>) {
m{^-+BEGIN (X509 |TRUSTED |)CERTIFICATE-} or next;
$usable_ca{SSL_ca_file} = $file;
last;
}
}
}
my $xt = $ENV{NO_NETWORK_TESTING} && 'n';
$xt ||= $yesno->( "Should I do external tests?\n".
"These test will detect if there are network problems and fail soft,\n".
"so please disable them only if you definitely don't want to have any\n".
"network traffic to external sites. [Y/n]", 'y' );
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'IO::Socket::SSL',
'ABSTRACT' => 'Nearly transparent SSL encapsulation for IO::Socket::INET.',
'AUTHOR' => 'Steffen Ullrich <sullr@cpan.org>, Peter Behroozi, Marko Asplund',
'LICENSE' => 'perl',
'DISTNAME' => 'IO-Socket-SSL',
'VERSION_FROM' => 'lib/IO/Socket/SSL.pm',
'PREREQ_PM' => {
'Net::SSLeay' => 1.46,
'Scalar::Util' => 0,
! %usable_ca ? ( 'Mozilla::CA' => 0 ):(),
},
'dist' => { COMPRESS => 'gzip', SUFFIX => 'gz', },
$xt eq 'y' ? ( test => { TESTS => 't/*.t t/external/*.t' }):(),
$ExtUtils::MakeMaker::VERSION >= 6.46 ? (
'META_MERGE' => {
resources => {
license => 'http://dev.perl.org/licenses/',
repository => 'https://github.com/noxxi/p5-io-socket-ssl',
homepage => 'https://github.com/noxxi/p5-io-socket-ssl',
bugtracker => 'https://github.com/noxxi/p5-io-socket-ssl/issues',
},
},
):(),
$ExtUtils::MakeMaker::VERSION >= 6.52 ? (
'CONFIGURE_REQUIRES' => {
"ExtUtils::MakeMaker" => 0,
'Net::SSLeay' => 1.46,
},
):(),
);
( run in 1.027 second using v1.01-cache-2.11-cpan-39bf76dae61 )