Andy,
I just went throught the considerable pain in almost exactly what you
have
done so far. I was extremly lucky to get the help of the folks on
this and
some other news groups. I am including 4 messages that detail many
steps that
need to be taken to fix files in the build process. Read all the
messages first
then see what your files look like, then take the steps slowly. Thats
what I
did and was finally able to compile yesterday. I did need to get a
new
Makefile.PL for the net::ssleay that had the correct set of
libraries. I
would be happy to send you that if you need it. Hope this helps. Here
goes

>From: "Francois Orsini" <[EMAIL PROTECTED]>
>To: <dougc@lynxhub>
>Subject: Re: Win 32 DLL library & NET_SSLEAY
>Date: Sat, 20 Mar 1999 14:28:53 -0800


Doug,

To get you moving, Here is what you need to do to fix your
compilation problem. I used Net_SSLeay 1.0.3, SSLeay 0.9.0b
and MSVC++ 6.0

1) The \use\local\ssl\include\bn.h file contains a  bn_blinding_st
structure
     definition with a "mod" member.  Rename it to "modnum".

2) In the \usr\local\ssl\include\ssl.h file, a function declaration
used a argument
    name of "list", which appears to be an MSVC reserved word, as this
generates a
    compiler error (under VC6 at least).  Rename the argument to
"listref". 
    NOTE: (2 instances of this type of error, in ssl.h)

3) ssleay.xs - Conversion errors with regards to the
SSL_CTX_set_verify function. 
    Attempting to convert a (SV *) to a (void *) - This is easy to
fix:
   
SSL_CTX_set_verify(ctx,mode,(int(*)(void))&ssleay_ctx_verify_callback_g
lue);
    
4) If you get some undefined for RAND_seed(), RAND_xxx(), etc...:
   Add: #include <rand.h>
   in ssleay.xs before "buffer.h"


>Date: Sat, 20 Mar 1999 17:37:44 -0500
>From: Jack Velte <[EMAIL PROTECTED]>
>Subject: Compiling Crypt::SSLeay on Windows with VC++
>To: dougc@lynxhub


Manually add the 3 ssl libraries to Crypt::SSLeay Makefile.  I couldn't get
makefile.pl to write the libraries correctly to the created Makefile.  I
added them to the EXTRALIBS and LDLOADLIBS lines.  You probably want to use
the path to the output of Your compilation in step 0.  :-)

"C:/Perl/local/openssl-SNAP-19990314-0330/out32dll/libeay32.lib"
"C:/Perl/local/openssl-SNAP-19990314-0330/out32dll/RSAglue.lib"
"C:/Perl/local/openssl-SNAP-19990314-0330/out32dll/ssleay32.lib"

------------------------------------------------------ 
3
------------------------------------------------------ 

Fix reserved words in openssl ssl.h and bn.h function prototype
headers.  My system needs the same fix for older versions of ssleay.
(Back to SSLeay-0.9.0b at least.)  Since you already compiled
openssl, and we are only changing function prototypes, this should
have no effect on Crypt::SSLeay.

I don't know why the C compiler complains about these reserved words when
compiling SSLeay/OpenSSL suite compiles, but it does.
------------------------------------------------------

ssl.h:
('list')
void SSL_set_client_CA_list(SSL *s, STACK *list);
->
void SSL_set_client_CA_list(SSL *s, STACK *list_x);

('list')
void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK *list);
->
void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK *list_x);

('mod')
bn.h:
 BIGNUM *mod; /* just a reference */
->
 BIGNUM *mod_x; /* just a reference */

('mod')
BN_BLINDING *BN_BLINDING_new(BIGNUM *A,BIGNUM *Ai,BIGNUM *mod);
->
BN_BLINDING *BN_BLINDING_new(BIGNUM *A,BIGNUM *Ai,BIGNUM *mod_x);

('na')
void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na,BN_ULONG *b,int nb);
->
void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na_x,BN_ULONG *b,int nb);

------------------------------------------------------
4
------------------------------------------------------

copy the openssl libraries to somewhere on your path.  (or your perl5lib
path -- i have my lib directory on both for now.)

------------------------------------------------------
"nmake" should now compile Crypt::SSLeay
"nmake install" installs the library.

now if you use 

new HTTP::Request('GET', "https://www.foo.com/"); 

the LWP library will automatically use the SSL libraries.

a simple test downloading a secure page worked for me.

-jack

>From: "Francois Orsini" <[EMAIL PROTECTED]>
>To: <dougc@lynxhub>
>Subject: Re: Win 32 DLL library & NET_SSLEAY
>Date: Sat, 20 Mar 1999 15:21:44 -0800


I know what it is...
all the functions must be declared ANSI (PROTO)...

so make sure the args type is declared within the function ()
such as:
static int
not_here(char *s)
{
    ....
    ....
}

You need to do this for all of them...
I must have done it but do not remember...

if it is too much hassle for you : i'll send you my ssleay.xs

Hope this helps,

--francois

-----Original Message-----
>From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>To: Francois Orsini <[EMAIL PROTECTED]>
>Date: Saturday, March 20, 1999 3:11 PM
>Subject: Re: Win 32 DLL library & NET_SSLEAY


>Francois,
>I made good progress with your help, thanks so much. I have now
>gotten past the compile problem for SSLeay.c, but have run into
>something strange in SSLeay.xs. I am getting the following error as I
>run nmake in the Net_SSLeay  directory against the generated makefile
>
>The error is
>
>SSLeay.xs(44) 's' : undeclared identifier
>SSLeay.xs(45) 'not_here' : function style initializer appears to be a
>function definition
>
>The piece of the SSLeay.xs file looks like
>
>static int
>not_here(s)
>char *s;
>{
>...... and so on
>
>
>It looks simple enough, but do you have any ideas
>
>Thanks
>
>Doug
>
>

>From: "Francois Orsini" <[EMAIL PROTECTED]>
>To: <dougc@lynxhub>
>Subject: Re: Win 32 DLL library & NET_SSLEAY
>Date: Sat, 20 Mar 1999 15:28:10 -0800


oh, there is something else you need to do; eventhough if
everything compiles/links; it will not work at runtime as the socket
descriptor used by net_ssleay will be invalid...This one was a tough
one to handle !

in ssleay.pm::sslcat()

replace:
set_fd($ssl, fileno(SSLCAT_S));

with:
set_fd($ssl, toSocket(fileno(SSLCAT_S)));

This is because Perl by default does not return the correct socket
number
but the Win32 fileno which is different on Windows platform (comparing
to
Unix !) - sighs...

the toSocket() routine has to be added/defined within ssleay.xs ..
put it after the sample hello() routine that Sampo has written; add it
as such:

int
toSocket(x)
int x;
 CODE:
#ifdef _WINDOWS
 RETVAL = _get_osfhandle(x);
#else
 RETVAL = x;
#endif
 OUTPUT:
 RETVAL

and now, before to compile/link ssleay.xs again, you have to change
the
PERL_ARCHIVE = $(PERL_INC)\perlcore.lib
_to_

PERL_ARCHIVE = $(PERL_INC)\perlCAPI.lib $(PERL_INC)\perlCRT.lib
$(PERL_INC)\perlcore.lib

in the generated 'Makefile' , in order to link and retrieve the
correct
_get_osfhandle() for toSocket() routine...otherwise the wrong one is
taken from
the Windows .lib's ....

-- 
Doug Courtney
[EMAIL PROTECTED]
(732)576-5572
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to