Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails onWindows with Visual Studio 2017 - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails onWindows with Visual Studio 2017
Date
Msg-id 20190528105802.GC2682@paquier.xyz
Whole thread Raw
In response to Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails onWindows with Visual Studio 2017  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Responses Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails onWindows with Visual Studio 2017  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
List pgsql-bugs
On Tue, May 28, 2019 at 07:31:55AM +0200, Juan José Santamaría Flecha wrote:
> Can you check if you get a sane compilation with the attached patch?
>
> It is just a compilation issue, once the software is built with the 1.1.x
> libraries you should not have any further problems to use SSL.

Could you add your patch to the upcoming commit fest please?  Here it
is:
https://commitfest.postgresql.org/23/

The scripts in src/tools/msvc/ make efforts for being able to compile
with OpenSSL 1.0.2 which is the latest LTS version of upstream, but we
lack facility to make them more dynamic depending on the version of
OpenSSL so as the compile flags of pg_config.h can be enforced
correctly.  So what you are doing in GetOpenSSLVersion() is something
that we are going to need badly, and OpenSSL has broken many
interfaces between 1.0.2 and 1.1.0.

+   # Startint at version 1.1.0 OpenSSL have changed their library names from:
+   #     libeay to libcrypto
+   #     ssleay to libssl

s/startint/starting/
Are these from the installers we recommend in the docs?  I mean these
ones:
https://slproweb.com/products/Win32OpenSSL.html

+   if (-e "$self->{options}->{openssl}/lib/VC/libssl32MD.lib")
Why not using a version-specific logic here?

+   my ($major, $minor) = $self->GetOpenSSLVersion();
+   if ($major == 1 && $minor == 1)
+   {
+       print $o "#define HAVE_BIO_GET_DATA 1\n";
+       print $o "#define HAVE_BIO_METH_NEW 1\n";
+   }
I think that you are missing HAVE_OPENSSL_INIT_SSL and
HAVE_ASN1_STRING_GET0_DATA here.  Please see commit message of
bde64eb.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Peter Billen
Date:
Subject: psql should re-read connection variables after connection reset
Next
From: PG Bug reporting form
Date:
Subject: BUG #15822: Incorrect handling of pending deletes