Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Think about Loose Coupling
 
PerlMonks  

Re: Again with PAR::Packer troubles

by Anonymous Monk
on Aug 17, 2011 at 10:25 UTC ( #920664=note: print w/ replies, xml ) Need Help??


in reply to Again with PAR::Packer troubles

Add

use IO::Socket::SSL qw(debug99);
and you'll get this from a.exe
DEBUG: IO/Socket/SSL.pm:1213: Invalid certificate authority locationse +rror:02001003:system library:fopen:No such process SSL error: 1724: 1 - error:2006D080:BIO routines:BIO_new_file:no such + file SSL error: 1724: 2 - error:0B084002:x509 certificate routines:X509_lo +ad_cert_crl_file:system lib

Problem, PAR doesn't know about C:\perl\site\5.14.1\lib\Mozilla\CA\cacert.pem, it doesn't pack it along with C:\perl\site\5.14.1\lib\Mozilla\CA.pm

Solution, add the file with

-a "C:\perl\site\5.14.1\lib\Mozilla\CA\cacert.pem;cacert.pem"

then in your .pl tell LWP about it

$ENV{PERL_LWP_SSL_CA_FILE} = File::Spec->catdir( $ENV{PAR_TEMP}, 'cacert.pem');

update: After testing, I see cacert.pem doesn't end up in root, so you'd have to something like

$ENV{PERL_LWP_SSL_CA_FILE} = File::Spec->catdir( $ENV{PAR_TEMP}, qw[ i +nc perl site 5.14.1 lib Mozilla CA cacert.pem ] );

Or specify a path where to install, like -a "C:\perl\site\5.14.1\lib\Mozilla\CA\cacert.pem;/cacert.pem" forget it, you'd have to use PAR::read_file for it to get unpacked, bah caveats

If Mozilla::CA had used File::ShareDir, you would simply add use File::ShareDir::PAR; to your .pl and it would just work

So, the bugs are as follows

  • IO::Socket::SSL doesn't give a useful error message to LWP::Protocol::https, so LWP can't give you a useful error message -- you shouldn't need debuging to learn which critical/fatal error occurred
  • Mozilla::CA doesn't use File::ShareDir
  • PAR doesn't automagically add File::ShareDir::PAR when it detects File::ShareDir
  • File::ShareDir::PAR is still experimental :)
  • PAR doesn't have an option to detect/pack  ssleay32.dll libeay32.dll


Comment on Re: Again with PAR::Packer troubles
Select or Download Code
Re^2: Again with PAR::Packer troubles
by jellisii2 (Pilgrim) on Aug 17, 2011 at 14:30 UTC

    The certificate file was the lynchpin.

    PP command:

    pp mech_test.pl -l \Perl\lib\Mozilla\CA\cacert.pm

    I've dealt with having to find files that I've had to include in PP built packages before. Here's how to deal with this particular one:

    use File::Spec; if (exists $ENV{PAR_PROGNAME}) { $ENV{PERL_LWP_SSL_CA_FILE} = File::Spec->catfile( $ENV{PAR_TEMP}, 'cacert.pem' ); }

    I can't remember where I got that gem from, but it helped me when I was first starting to build Tkx apps. In my case, I stick this in a BEGIN block, so that the environment is right before I do anything else.

    Thank you all for your patience and help.

    Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Node Status?
    node history
    Node Type: note [id://920664]
    help
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (15)
    As of 2014-04-24 10:38 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (565 votes), past polls