perlnewb123 has asked for the wisdom of the Perl Monks concerning the following question:

Monks, has anyone had a problem/resolution with running a perl exe compiled by perl2exe, where the source uses Crypt::SSLeay? Source script itself works great, creating the exe goes fine with no errors, but when executing the exe, it errors out prompting to install Crypt::SSLeay.
Server returned error: 501 Protocol scheme 'https' is not supported (C +rypt::SSLeay not installed)
Using this does not help:
#perl2exe_include "Crypt/SSLeay.pm"

Replies are listed 'Best First'.
Re: perl2exe and
by Corion (Patriarch) on Mar 25, 2009 at 08:17 UTC

    You haven't told us much, but my guess is that the "other" DLLs required by Crypt::SSLeay are not bundled with your .exe. You will need at least:

    • libeay32.dll
    • libssl32.dll
    • ssleay32.dll
    • and possibly zlib.dll

    They live either in the same directory where your perl.exe lives or in the Windows directory somewhere, propably C:\Windows\System32. Copy them from there and either distribute them with your executable or make PAR include the DLL in the file.

    Also, searching this site for site:perlmonks.org crypt::ssleay libeay32.dll yields many post that would have told you that.

Re: perl2exe and
by imrags (Monk) on Mar 25, 2009 at 09:03 UTC
    I've used perl2exe a few times and came across similar problems
    While creating the exe, i had to declare every module
    in the perl script explicitly at the beginning like "use Win32::OLE"; use File::Copy; etc..
    Ensure that you do this for all the modules and give it a try
    If you do not use "use" statements, then sometimes, you might
    face error (Well, by using those files, is how i solved my problem)
    Raghu
      Below is a section of the script. Ive included the dlls in the script, when running the exe the dlls attempt to install to the tmp location, but it's trying to save them with the full path given in the script. Could someone take a look and let me know what you think?
      C:\CAM>cam_reset.exe ERROR: Can't create C:\DOCUME~1\user\LOCALS~1\Temp/p2xtmp-1084/C:/WINN +T/system32/ssleay32.dll
      #!\C:\strawberry\perl\bin use HTTP::Request::Common qw(POST GET); use HTTP::Headers; use LWP::UserAgent; use MIME::Base64; use Crypt::SSLeay; #perl2exe_include HTTP::Headers #perl2exe_include LWP::UserAgent #perl2exe_include MIME::Base64 #perl2exe_include Crypt::SSLeay #perl2exe_include "Crypt/SSLeay.pm" #perl2exe_include "C:\WINNT\system32\libeay32.dll" #perl2exe_include "C:\WINNT\system32\libssl32.dll" #perl2exe_include "C:\WINNT\system32\ssleay32.dll" # set up the stuff my $ua = LWP::UserAgent->new(); # Set our own user-agent string! $ua->agent("CCAAgent/v3.5.8 CleanAccessManager API"); # Set the Basic Authentication credentials $encoded = encode_base64('test:test'); my $url = "https://test/admin/cisco_api.jsp"; # Params required for the POST... if (($ARGV[0] eq 'addmac') and defined($ARGV[1])) { my $req = POST $url, 'Authorization' => "Basic ".$encoded, Content => [ admin => "test", passwd => "test,.", op => "addmac", mac => "$ARGV[1]", user => "i-command", provider => "pxebuild", type => "userole", role => "Authorized_Asset", desc => "Reset via icmd" # no comma here! ]; # Fire the cannon now ! my $res = $ua->request($req); # Get the error back from the server if any my $err = $res->status_line; if ($err != 200) { print "Server returned error: $err\n"; exit 1; } # Just print the whole stuff #print $res->as_string; # Just print the return html print $res->content; exit 0;