aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-04-30 08:14:02 +0900
committerMichael Paquier <michael@paquier.xyz>2020-04-30 08:14:02 +0900
commite30b0b5cfaeb4f1f739f82c34c5ae2773852a088 (patch)
treec8697ef2b1cd172dd9109be9e485fd33d1ed075c
parent1816a1c6ffe46782eee9a16a974b4aa3f4b8457b (diff)
downloadpostgresql-e30b0b5cfaeb4f1f739f82c34c5ae2773852a088.tar.gz
postgresql-e30b0b5cfaeb4f1f739f82c34c5ae2773852a088.zip
Fix check for conflicting SSL min/max protocol settings
Commit 79dfa8a has introduced a check to catch when the minimum protocol version was set higher than the maximum version, however an error was getting generated when both bounds are set even if they are able to work, causing a backend to not use a new SSL context but keep the old one. Author: Daniel Gustafsson Discussion: https://postgr.es/m/14BFD060-8C9D-43B4-897D-D5D9AA6FC92B@yesql.se
-rw-r--r--src/backend/libpq/be-secure-openssl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index a65f920343c..42c5c07e580 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -226,12 +226,14 @@ be_tls_init(bool isServerStart)
* as the code above would have already generated an error.
*/
if (ssl_ver_min > ssl_ver_max)
+ {
ereport(isServerStart ? FATAL : LOG,
(errmsg("could not set SSL protocol version range"),
errdetail("\"%s\" cannot be higher than \"%s\"",
"ssl_min_protocol_version",
"ssl_max_protocol_version")));
- goto error;
+ goto error;
+ }
}
/* disallow SSL session tickets */