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

I'm having trouble getting the very simplest https application to work on ActiveState perl on Windows XP.

The error I get is a popup:
Application popup: perl.exe - Unable To Locate Component : This application has failed to start because SSLEAY32.dll was not found. Re-installing the application may fix this problem.

After the popup, the output of the program is the text "501", which I believe is an http error number.

The dll indicated IS present, and in the right place (see "perl -V" below).
Update:The dll was absent after a successful ppm module install. See discussion below.

The code is straight from the sample in Crypt::SSLeay -

use strict; # I added only this line use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = new HTTP::Request('GET', 'https://www.nodeworks.com'); my $res = $ua->request($req); print $res->code."\n";
Crypt:::SSLeay was installed using ppm. Install was successful:
ppm> install Crypt-SSLeay ==================== Install 'Crypt-SSLeay' version 0.51 in ActivePerl 5.8.0.806. ==================== Downloaded 29927 bytes. Extracting 15/15: blib/html/site/lib/Crypt/SSLeay.html Installing D:\Perl\site\lib\auto\Crypt\SSLeay\SSLeay.dll Installing D:\Perl\site\lib\auto\Crypt\SSLeay\SSLeay.lib Installing D:\Perl\site\lib\auto\Crypt\SSLeay\SSLeay.exp Installing D:\Perl\site\lib\auto\Crypt\SSLeay\SSLeay.bs Installing D:\Perl\html\site\lib\Crypt\SSLeay.html Installing D:\Perl\site\lib\Net\SSL.pm Installing D:\Perl\site\lib\Crypt\SSLeay.pm Installing D:\Perl\site\lib\Crypt\SSLeay\X509.pm Installing D:\Perl\site\lib\Crypt\SSLeay\MainContext.pm Installing D:\Perl\site\lib\Crypt\SSLeay\Conn.pm Installing D:\Perl\site\lib\Crypt\SSLeay\CTX.pm Installing D:\Perl\site\lib\Crypt\SSLeay\Err.pm Successfully installed Crypt-SSLeay version 0.51 in ActivePerl 5.8.0.8 +06. ppm>
Perl paths are also fine :
>perl -V Summary of my perl5 (revision 5 version 8 subversion 0) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultip +licity=def ine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D +_CONSOLE - DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_ +SYS -DUSE_ PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksi ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"D: \Perl\lib\CORE" -machine:x86' libpth="E:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK +\Lib\" "D: \Perl\lib\CORE" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32 .lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uui +d.lib wsoc k32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt. +lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comd lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib + uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msv +crt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf - libpath:"D:\Perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL +_IMPLICIT_ CONTEXT PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 806 Built under MSWin32 Compiled at Mar 31 2003 00:45:44 @INC: D:/Perl/lib D:/Perl/site/lib . E:\Documents and Settings\vijay\test>dir D:\Perl\site\lib\auto\Crypt\S +SLeay\SSLe ay.dll Volume in drive D is Datum Volume Serial Number is 08B1-4974 Directory of D:\Perl\site\lib\auto\Crypt\SSLeay 11/10/2003 11:17 PM 32,768 SSLeay.dll 1 File(s) 32,768 bytes 0 Dir(s) 8,527,851,520 bytes free

Edit: BazB, removed colour font tags.

Replies are listed 'Best First'.
Re: Win32 binaries for SSLeay.
by BrowserUk (Patriarch) on Nov 20, 2003 at 08:27 UTC

    I located a binary distribution of SSLeay for Win32 which contains the SSLeay32.dll (+others binaries and sources) here.

    An extremely cursory test seems to indicate that these work with Crypt::SSLeay from Jenda's repository.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!
    Wanted!

      Success !!!

      I downloaded 2791797 Sep 30 14:50:15 2003 openssl-0.9.7c.tar.gz LATEST from http://www.openssl.org/source/ and followed the instructions in INSTALL.W32 to compile it (Using Visual Studio .NET). This took about 10 minutes of compile time - this is pretty big!.

      The compile process generated the 2 dll's in the out32dll directory, which I then tested as recommended in the INSTALL.W32 file. All tests were successful.

      I then copied these dll's into the G:\Perl\site\lib\auto\Crypt\SSLeay directory, and ran the test program - it ran correctly !.

      2 remaining questions for posterity :
      - Is there a way/location to post my binaries for other monks to use ?
      - It seems to me that the CPAN distribution of this module needs to be fixed - I'd like some consensus/direction on this issue before attempting to whine to CPAN and the author(s).

        Is there a way/location to post my binaries for other monks to use ?
        There is no need. Grab yourself a copy of PPM::Repositories and add some repositories to your ppm configuration.
        E:\>ppm3-bin PPM - Programmer's Package Manager version 3.0.1. Copyright (c) 2001 ActiveState SRL. All Rights Reserved. Entering interactive shell. Using Term::ReadLine::Stub as readline lib +rary. Profile tracking is not enabled. If you save and restore profiles manu +ally, your profile may be out of sync with your computer. See 'help profile' + for more information. Type 'help' to get started. ppm> rep Repositories: [1] ppm [2] crazy [3] jenda [4] theory ppm> s *SSLea* Searching in Active Repositories 1. Crypt-SSLeay [0.51] 2. Crypt-SSLeay [0.51] OpenSSL glue that provides LWP https support 3. Net_SSLeay.pm [1.25] Perl extension for using OpenSSL ppm> desc 1 ==================== Package 1: Name: Crypt-SSLeay Version: 0.51 Author: Title: Crypt-SSLeay Abstract: Location: crazy Available Platforms: 1. MSWin32-x86-multi-thread-5.8 ==================== ppm> desc 2 ==================== Package 2: Name: Crypt-SSLeay Version: 0.51 Author: Joshua Chamas <josh (at) chamas dot com> Title: Crypt-SSLeay Abstract: OpenSSL glue that provides LWP https support Location: theory Available Platforms: 1. MSWin32-x86-multi-thread-5.8 ==================== ppm> desc --dump 1 ==================== Package 1: <SOFTPKG NAME="Crypt-SSLeay" VERSION="0,51,0,0"> <TITLE>Crypt-SSLeay</TITLE> <ABSTRACT></ABSTRACT> <AUTHOR></AUTHOR> <IMPLEMENTATION> <OS NAME="MSWin32" /> <ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8" /> <INSTALL EXEC="PPM_PERL" HREF="http://crazyinsomniac.perlmonk.org/perl/ppm/scripts/install_ssl" +>install_ssl</INSTALL> <CODEBASE HREF="Crypt-SSLeay-0.51.tar.gz" /> </IMPLEMENTATION> </SOFTPKG> ==================== ppm> desc --dump 2 ==================== Package 2: <SOFTPKG NAME="Crypt-SSLeay" VERSION="0,51,0,0"> <TITLE>Crypt-SSLeay</TITLE> <ABSTRACT>OpenSSL glue that provides LWP https support</ABSTRA +CT> <AUTHOR>Joshua Chamas &lt;josh (at) chamas dot com&gt;</AUTHOR +> <IMPLEMENTATION> <OS NAME="MSWin32" /> <ARCHITECTURE NAME="MSWin32-x86-multi-thread-5.8" /> <CODEBASE HREF="http://theoryx5.uwinnipeg.ca/ppms/x86/ +Crypt-SSLeay.tar.gz" /> </IMPLEMENTATION> </SOFTPKG> ==================== ppm> install 1 Package 1: Note: Package 'Crypt-SSLeay' is already installed. ==================== Install 'Crypt-SSLeay' version 0.51 in ActivePerl 5.8.0.804. ==================== Downloaded 20558 bytes. Extracting 26/26: blib/lib/Net/SSL.pm Files found in blib\arch: installing files in blib\lib into architectu +re dependent library tree Writing G:\Perl\site\lib\auto\Crypt\SSLeay\.packlist A copy of the needed library libeay32.dll was found in your PATH environment variable, under G:\perl\bin. If this is compatible with the version (0.9.7a) used to compile the Perl module, no further action is needed to complete the installation. Fetch libeay32.dll? [no] Aborting download of libeay32.dll. A copy of the needed library ssleay32.dll was found in your PATH environment variable, under G:\perl\bin. If this is compatible with the version (0.9.7a) used to compile the Perl module, no further action is needed to complete the installation. Fetch ssleay32.dll? [no] Aborting download of ssleay32.dll. Successfully installed Crypt-SSLeay version 0.51 in ActivePerl 5.8.0.8 +04. ppm> ppm> rep desc theory Describing Active Repository 4: Name: theory Location: http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServe +r58 Type: PPMServer 2.0 ppm> rep desc crazy Describing Active Repository 2: Name: crazy Location: http://crazyinsomniac.perlmonk.org/perl/ppm/5.8 Type: Webpage ppm> ppm>q
        So it appears that Randy Kobes (theory guy), mispackaged his latest release of Crypt-SSLeay (namely he forgot about http://theoryx5.uwinnipeg.ca/ppms/scripts/install_ssl).

        update: I've emailed him and he's fixed it (you should see something similar to what you see when installing from my repository).

        - It seems to me that the CPAN distribution of this module needs to be fixed - I'd like some consensus/direction on this issue before attempting to whine to CPAN and the author(s).
        How so (i don't recall anything being broken)?

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

      Thanks, BrowserUk(++)
      - I did extract and install the SSLeay32.dll from http://opensores.thebunker.net/pub/mirrors/SSLeay/binaries/SSLeay-0.8.1-DSA-msw32.zip. This fixed the original issue with the popup, but brought out new issues:

      Application popup: perl.exe - Ordinal Not Found : The ordinal 99 could not be located in the dynamic link library LIBEAY32.dll.

      After extracting and copying LIBEAY32.dll, I get the same popup, except it is looking for ordinal 115.

      It looks like these dll's are not compatible with my version of SSLeay.

      I looked at http://www.bacus.pt/Net_SSLeay/, which says that SSLeay is obsolete/unsupported - go look at http://www.openssl.org/. Now I'm getting lost and confused - what module(s) should I be using to get https pages under win32? Sample code, anyone ?

Re: Crypt:::SSLeay problems on Win32
by BrowserUk (Patriarch) on Nov 20, 2003 at 07:34 UTC

    The error message is referring to SSLEAY32.dll, but the dll installed is SSLEAY.dll?

    This suggests that the either the dll was named incorrectly when the PPM was built, or that it has a dependancy upon another dll that isn't shipped as a part of the PPM package.

    If the former is the case, it may be as simple as renaming SSLEAY.dll to SSLEAY32.dll -- it would be worth trying. Otherwise, you may need to locate and install something else in addition to the PPM?

    Update: The dll SSLeay.dll that comes in the PPM for Crypt::SSLeay has a dependancy upon a second dll called SSLeay32.dll that is not distributed with it. I haven't worked out where you get that, or the sources to build it yet. There doesn't seem to be any mention of it in the POD. Maybe someone (PodMaster?) knows.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!
    Wanted!