pgsql: Clear OpenSSL error queue after failed X509_STORE_load_locations

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Clear OpenSSL error queue after failed X509_STORE_load_locations
Date: 2016-10-07 09:54:55
Message-ID: E1bsRrj-00037N-UZ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clear OpenSSL error queue after failed X509_STORE_load_locations() call.

Leaving the error in the error queue used to be harmless, because the
X509_STORE_load_locations() call used to be the last step in
initialize_SSL(), and we would clear the queue before the next
SSL_connect() call. But previous commit moved things around. The symptom
was that if a CRL file was not found, and one of the subsequent
initialization steps, like loading the client certificate or private key,
failed, we would incorrectly print the "no such file" error message from
the earlier X509_STORE_load_locations() call as the reason.

Backpatch to all supported versions, like the previous patch.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/e84e4761f7ff83d657852d0d0a363868be715df2

Modified Files
--------------
src/interfaces/libpq/fe-secure.c | 1 +
1 file changed, 1 insertion(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-10-07 11:39:11 pgsql: Don't allow both --source-server and --source-target args to pg_
Previous Message Heikki Linnakangas 2016-10-07 09:25:05 pgsql: Don't share SSL_CTX between libpq connections.