NAME

Crypt::SSLeay - OpenSSL glue that provides LWP https support

SYNOPSIS

lwp-request https://www.nodeworks.com

use LWP::UserAgent;
my $ua = new LWP::UserAgent;
my $req = new HTTP::Request('GET', 'https://www.nodeworks.com');
my $res = $ua->request($req);

DESCRIPTION

This perl module provides support for the https protocol under LWP, so that a LWP::UserAgent can make https GET & HEAD & POST requests. Please see perldoc LWP for more information on POST requests.

The Crypt::SSLeay package contains Net::SSL, which is automatically loaded by LWP::Protocol::https on https requests, and provides the necessary SSL glue for that module to work via these deprecated modules:

Crypt::SSLeay::CTX
Crypt::SSLeay::Conn
Crypt::SSLeay::X509

Work on Crypt::SSLeay has been continued only to provide https support for the LWP - libwww perl libraries. If you want access to the OpenSSL API via perl, check out Sampo's Net::SSLeay.

INSTALL

OpenSSL

You must have OpenSSL or SSLeay installed before compiling this module. You can get the latest OpenSSL package from:

http://www.openssl.org

When installing openssl make sure your config looks like:

 > ./config --openssldir=/usr/local/openssl
or
 > ./config --openssldir=/usr/local/ssl

then
 > make
 > make test
 > make install

This way Crypt::SSLeay will pick up the includes and libraries automatically. If your includes end up going into a separate directory like /usr/local/include, then you may need to symlink /usr/local/openssl/include to /usr/local/include

Crypt::SSLeay

The latest Crypt::SSLeay can be found at your nearest CPAN, and also:

http://www.perl.com/CPAN-local/modules/by-module/Crypt/

Once you have downloaded it, Crypt::SSLeay installs easily using the make or nmake commands as shown below.

> perl Makefile.PL
> make
> make test
> make install

* use nmake for win32

COMPATIBILITY

This module has been compiled on the following platforms:

PLATFORM	CPU 	SSL		PERL	 VER	DATE		WHO
--------	--- 	---		----	 ---	----		---
AIX 4.3.2	RS/6000	OpenSSL 0.9.5a	5.6.0	 .17	2000-09-15	Peter Heimann
Solaris 2.6	x86	OpenSSL 0.9.5a	5.00501	 .17    2000-09-04	Joshua Chamas	
WinNT SP6 	x86	OpenSSL 0.9.4	5.00404	 .17	2000-09-04	Joshua Chamas
Linux 2.2.12   x86     OpenSSL 0.9.5a  5.00503	 .16	2000-07-13      David Harris
FreeBSD 3.2	?x86	OpenSSL 0.9.2b	5.00503	 ?      1999-09-29	Rip Toren
Solaris 2.6	?Sparc	OpenSSL 0.9.4	5.00404	 ?      1999-08-24	Patrick Killelea
FreeBSD 2.2.5	x86	OpenSSL 0.9.3	5.00404	 ?      1999-08-19	Andy Lee
Solaris 2.5.1	USparc	OpenSSL 0.9.4	5.00503	 ?      1999-08-18	Marek Rouchal
Solaris 2.6	x86	SSLeay 0.8.0	5.00501	 ?      1999-08-12	Joshua Chamas	
Linux 2.2.10	x86 	OpenSSL 0.9.4	5.00503	 ?      1999-08-11	John Barrett
WinNT SP4	x86	SSLeay 0.9.2	5.00404	 ?      1999-08-10	Joshua Chamas

BUILD NOTES

AIX 4.3.2 - Symbol Error: __umoddi3 : referenced symbol not found

The __umoddi3 problem applies here as well when compiling with gcc.

Alternative solution: In Makefile.PL, prepend "-L/usr/local/<path to your gcc lib>/<version> " to the $LIBS value. Add after line 82:

$LIBS = '-L' . dirname `gcc -print-libgcc-file-name` . ' ' . $LIBS;

Solaris x86 - Symbol Error: __umoddi3 : referenced symbol not found

Problem:

On Solaris x86, the default PERL configuration, and preferred, is to use the ld linker that comes with the OS, not gcc. Unfortunately during the OpenSSL build process, gcc generates in libcrypto.a, from bn_word.c, the undefined symbol __umoddi3, which is supposed to be later resolved by gcc from libgcc.a

The system ld linker does not know about libgcc.a by default, so when building Crypt::SSLeay, there is a linker error for __umoddi3

Solution:

The fix for this symlink your libgcc.a to some standard directory like /usr/local/lib, so that the system linker, ld, can find it when building Crypt::SSLeay.

FreeBSD 2.x.x / Solaris - ... des.h:96 #error _ is defined ...

If you encounter this error: "...des.h:96: #error _ is defined, but some strange definition the DES library cannot handle that...," then you need to edit the des.h file and comment out the "#error" line.

Its looks like this error might be common to other operating systems, and that occurs with OpenSSL 0.9.3. Upgrades to 0.9.4 seem to fix this problem.

NOTES

Many thanks to Gisle Aas for the original writing of this module and many others including libwww for perl. The web will never be the same :)

Ben Laurie deserves kudos for his excellent patches for better error handling, SSL information inspection, and random seeding.

James Woodyatt is a champ for finding a ridiculous memory leak that has been the bane of many a Crypt::SSLeay user.

SUPPORT

For OpenSSL and Crypt::SSLeay support, please email the openssl user mailing list at openssl-users@openssl.org

Emails to the list sent with at least Crypt::SSLeay in the subject line will be responded to more quickly by myself.

This module was originally written by Gisle Aas, and I am now maintaining it.

COPYRIGHT

Copyright (c) 1999-2000 Joshua Chamas.
Copyright (c) 1998 Gisle Aas.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.