Dave Page wrote:
> [CCing Magnus as this could be a problem - pgAdmin 1.8 fails to connect
> to an SSL server with a 'real' certificate]
>
> Alejandro Gasca wrote:
>> Well, i download the postgresql-8.2.4-1-binaries-no-installer.zip.
>> the psql packed there connects without problem.
>
> Well the main difference between those builds is that pgAdmin 1.8 uses a
> version of libpq.dll compiled with MSVC++ rather than mingw, and ships
> with OpenSSL 0.9.8.5 instead of 0.9.8.1 - which is a touch worrying.
OK, on further research it sounds like this might be problem:
http://www.openssl.org/support/faq.html#PROG2
To recap, the error reported was:
OPENSSL_Uplink(00914010,05): no OPENSSL_Applink.
The patch below adds the applink code to libpq. Alejandro; may I send
you an updated libpq.dll to test?
Magnus; assuming this works, we should add it to the server as well I
guess - src/backend/libpq/be-secure.c seem reasonable?
Regards, Dave
Index: fe-secure.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v
retrieving revision 1.94
diff -u -r1.94 fe-secure.c
--- fe-secure.c 16 Feb 2007 17:07:00 -0000 1.94
+++ fe-secure.c 26 Sep 2007 15:36:45 -0000
@@ -153,8 +153,17 @@static bool pq_initssllib = true;
static SSL_CTX *SSL_context = NULL;
+
+/* Include the OpenSSL AppLink code on Windows to ensure the */
+/* runtime libraries work in a compatible way */
+#ifdef WIN32
+#include "openssl/applink.c"
+#endif
+#endif
/* ------------------------------------------------------------ *//* Procedures common to all secure
sessions *//* ------------------------------------------------------------ */