Skip site navigation (1) Skip section navigation (2)

Re: [psqlODBC 08.02.0402] OpenSSL libraries

From: Rainer Bauer <usenet(at)munnin(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: [psqlODBC 08.02.0402] OpenSSL libraries
Date: 2007-06-04 17:53:24
Message-ID: jra8639bmrsjjlb1mn07v81jvgm8rbu6a4@4ax.com (view raw or flat)
Thread:
Lists: pgsql-odbc
Hiroshi Inoue wrote:

>Rainer Bauer wrote:
>> I checked out the latest head version today 08.02.0402 to find a solution for
>> the new OpenSSL DLL naming scheme.
>
>Do you get OpenSSL libraries from 
>http://www.slproweb.com/products/Win32OpenSSL.html ?

Yes.

>Though I can find ssleay32(MT]MD)(d).lib in C:\OpenSSL\lib\vc, I can't
>find ssleay32(MT|MD)(d).dll. What's the differnce among ssleay32xx.lib ?

Sorry this was my fault.: I didn't search for the DLLs installed by OpenSSL.
The difference between /MT and /MD is explained here:
<http://msdn2.microsoft.com/en-us/library/2kzt1wy3(VS.80).aspx>
The /MT option defines _MT whereas the /MD option defines _MT and _DLL
resulting in different runtimes being linked.

According to the FAQ <http://www.openssl.org/support/faq.html#PROG2>, psqlODBC
should contain the code for OPENSSL_Applink() (see also
<http://www.openssl.org/docs/crypto/OPENSSL_Applink.html>), because it is
linked with a different setting. But that is not the case!

So there are a few open questions:
Why is psqlODBC build with /MT and not /MD?
Why are SSL connections working at all (I assume they are, since I cannot test
it here), if the OpenSSL DLLs and psqlODBC are linked to different runtimes?

Regardless of these issues, my approach would make sense (the DLLs are not
renamed), we just have to include the correct lib files in loadlib.c based on
the installed OpenSSL version:

>> I wanted to produce a patch for loadlib.c based on the following idea:
>> 
>> 1) Include openssl/opensslv.h
>> 2) Based on the version number OPENSSL_VERSION_NUMBER defined in that file
>> either link with ssleay32.lib or ssleay32MT.lib (respectively libeay32.lib or
>> libeay32MT.lib).


>> PS: Can someone shed some light why delay loading is used in loadlib.c?
>
>Because the driver can live without libpq, ssleay32 or pgenlist.
>If you use SSL connections, libpq and ssleay32 are loaded dynamically.
>If you enlist in MSDTC, pgenlist(a) is loaeded dynamically.

I see.

Another question: How many active developers are there for Win32? And what
compilers are they using? Dopping support for VC6 would clean up the code (at
least in loadlib.c and the makefile).

Rainer

In response to

Responses

pgsql-odbc by date

Next:From: Mark Cave-AylandDate: 2007-06-04 21:23:08
Subject: Re: Build problems with latest CVS (2007-06-03) on MSVC++Express 2005
Previous:From: Hiroshi InoueDate: 2007-06-04 15:02:56
Subject: Re: [psqlODBC 08.02.0402] OpenSSL libraries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group