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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-odbc by date

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