PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15789
PG Version11.2
OSWindows 10
Opened2019-05-02 13:57:27+00
Reported bySergey Pashkov
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15789
Logged by:          Sergey Pashkov
Email address:      (redacted)
PostgreSQL version: 11.2
Operating system:   Windows 10
Description:        

libssh2 and libpq are used in the same product.
It is necessary to use OpenSSL 1.1.1b as it includes EdDSA support required
for libssh2.

Here are parts of our build scripts.

1. Building OpenSSL:
perl Configure VC-WIN64A no-shared no-asm enable-ssl3 enable-ssl3-method
nmake

2. Building libpq:
XCOPY /s /i "%OPENSSL_SRCS%" "%OPENSSL_PATH%"
MKDIR "%OPENSSL_PATH%\lib"
COPY "%THIRD_LIBS%\libssl_64.lib" "%OPENSSL_PATH%\lib\ssleay32.lib"
COPY "%THIRD_LIBS%\libcrypto_64.lib" "%OPENSSL_PATH%\lib\libeay32.lib"

perl mkvcbuild.pl
COPY config_default.pl config.pl
sed -i "s/openssl   => undef/openssl   => \"%OPENSSL_PATH_ESC%\"/g"
config.pl
perl mkvcbuild.pl
msbuild pgsql.sln /t:interfaces\libpq /p:Configuration="Release" /m

The following errors are encountered:

       "C:\Users\User\AppData\Local\Temp\postgres_64\libpq.vcxproj" (default
target) (6) ->
       (ClCompile target) ->
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1467):
error C2037: left
        of 'ptr' specifies undefined struct/union 'bio_st'
[C:\Users\User\AppData\Local\Temp\postgres_64\libpq.vcxproj]
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1467):
error C2198: 'pqs
       ecure_raw_read': too few arguments for call
[C:\Users\User\AppData\Local\Temp\postgres_64\libpq.vcxproj]
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1497):
error C2037: left
        of 'ptr' specifies undefined struct/union 'bio_st'
[C:\Users\User\AppData\Local\Temp\postgres_64\libpq.vcxproj]
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1497):
error C2198: 'pqs
       ecure_raw_write': too few arguments for call
[C:\Users\User\AppData\Local\Temp\postgres_64\libpq.vcxproj]
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1556):
error C2027: use
       of undefined type 'bio_method_st'
[C:\Users\User\AppData\Local\Temp\postgres_64\libpq.vcxproj]
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1559):
error C2027: use
       of undefined type 'bio_method_st'
[C:\Users\User\AppData\Local\Temp\postgres_64\libpq.vcxproj]
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1560):
error C2037: left
        of 'bread' specifies undefined struct/union 'bio_method_st'
[C:\Users\User\AppData\Local\Temp\postgres_64\libpq
       .vcxproj]
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1561):
error C2037: left
        of 'bwrite' specifies undefined struct/union 'bio_method_st'
[C:\Users\User\AppData\Local\Temp\postgres_64\libp
       q.vcxproj]
        
c:\users\user\appdata\local\temp\postgres_64\src\interfaces\libpq\fe-secure-openssl.c(1587):
error C2037: left
        of 'ptr' specifies undefined struct/union 'bio_st'
[C:\Users\User\AppData\Local\Temp\postgres_64\libpq.vcxproj]

Headers of the recent OpenSSL versions don't include bio_st definition, as
it was in 1.0.2.

If I manually define the following macros in pg_config.h:

HAVE_BIO_GET_DATA
HAVE_BIO_METH_NEW 

- compilation passes but SSL connection cannot be established anyway.

This question was raised in the following thread:
https://www.postgresql.org/message-id/flat/CAAw-Mseg9JYpp%3DA%3D51HR3rKiQtbvT0MWw%2BaYFwNeJEbdNr%3DCDA%40mail.gmail.com

No solution was proposed.

Thank you!

Messages

DateAuthorSubject
2019-05-02 13:57:27+00PG Bug reporting formBUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-05-28 05:31:55+00=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?=Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-05-28 10:58:02+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-05-31 14:11:37+00=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?=Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-05-31 17:17:11+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-03 10:00:49+00Sandeep ThakkarRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-03 23:51:32+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-05 07:29:21+00=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?=Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-20 02:49:41+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-21 10:23:21+00=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?=Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-22 02:44:33+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-24 11:44:18+00=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?=Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-25 08:08:11+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-25 09:43:29+00=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?=Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-25 13:52:43+00Alvaro HerreraRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-26 01:22:56+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-26 01:48:03+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017
2019-06-26 14:12:11+00Michael PaquierRe: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017