postgres.git / summary / log / commit / refs
commit 5d5dc6f68aeff20822ae28fae6c51f634c878278
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Fri Oct 07 09:53:49 2016 +0000
First released in: 10.0, 9.1.24, 9.2.19, 9.3.15, 9.4.10, 9.5.5, 9.6.1
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.
src/interfaces/libpq/fe-secure.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/interfaces/libpq/fe-secure.c b/src/interfaces/libpq/fe-secure.c
index c679d243cc4..723676124f4 100644
--- a/src/interfaces/libpq/fe-secure.c
+++ b/src/interfaces/libpq/fe-secure.c
@@ -1121,6 +1121,7 @@ initialize_SSL(PGconn *conn)
#endif
}
/* if not found, silently ignore; we do not require CRL */
+ ERR_clear_error();
}
have_rootcert = true;
}
[parent: e7bb327e3472]