Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: byavuz81@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>, Heikki Linnakangas <heikki.linnakangas@iki.fi>, Michael Paquier <michael@paquier.xyz>
Date: 2022-02-03T00:42:34Z
Lists: pgsql-bugs
On Thu, Feb 3, 2022 at 10:39 AM Andres Freund <andres@anarazel.de> wrote:
> Daniel, Heikki, Michael CCing you as you seem to have worked most on those
> tests and libressl fixes.

I guess the previous commits mentioning libressl were just getting it
to compile on OpenBSD?  Very few BF animals actually run the ssl tests
(which requires setting PG_TEST_EXTRA="ssl").  That said, people are
definitely running PostgreSQL with SSL on OpenBSD in the wild, so it's
at least partially working.  I wonder if the problem is something that
needs to be configured in /etc/ssl/openssl.cnf (something like
https://obsd.solutions/en/blog/2020/06/08/libressl-error-due-to-missing-v3_ca-in-extension/
though that doesn't seem to be it).

Anyway, I can also reproduce this problem on my Vagrant image (OpenBSD
6.9 'cause I haven't got around to setting up 7).  Just in case it
helps someone who (unlike me) knows enough about libressl to debug
this and knows how to drive vagrant, here's a reproducer:

git clone https://github.com/macdice/postgresql-dev-vagrant.git
cd postgresql-dev-vagarant/openbsd6
vagrant up
... wait for installation and build ...
vagrant ssh
cd postgres/src/test/ssl
gmake check



Commits

  1. Move libpq's write_failed mechanism down to pqsecure_raw_write().

  2. Fix thinko in PQisBusy().

  3. Set SNI ClientHello extension to localhost in tests

  4. Improve worst-case performance of text_position_get_match_pos()