diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-01-04 12:43:52 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-01-04 12:44:03 -0500 |
commit | 6667d9a6d77b9a6eac89638ac363b6d03da253c1 (patch) | |
tree | 5a2e47b21b2c58095514d8048df5c84435dc5832 /src/backend/libpq/be-secure.c | |
parent | 0fad355beca9f73687c0b27647ea570ce10c7ae3 (diff) |
Re-allow SSL passphrase prompt at server start, but not thereafter.
Leave OpenSSL's default passphrase collection callback in place during
the first call of secure_initialize() in server startup. Although that
doesn't work terribly well in daemon contexts, some people feel we should
not break it for anyone who was successfully using it before. We still
block passphrase demands during SIGHUP, meaning that you can't adjust SSL
configuration on-the-fly if you used a passphrase, but this is no worse
than what it was before commit de41869b6. And we block passphrase demands
during EXEC_BACKEND reloads; that behavior wasn't useful either, but at
least now it's documented.
Tweak some related log messages for more readability, and avoid issuing
essentially duplicate messages about reload failure caused by a passphrase.
Discussion: https://postgr.es/m/29982.1483412575@sss.pgh.pa.us
Diffstat (limited to 'src/backend/libpq/be-secure.c')
-rw-r--r-- | src/backend/libpq/be-secure.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c index e5ee974c270..785dadb6c2f 100644 --- a/src/backend/libpq/be-secure.c +++ b/src/backend/libpq/be-secure.c @@ -65,15 +65,15 @@ bool SSLPreferServerCiphers; /* * Initialize global context. * - * If failOnError is true, report any errors as FATAL (so we don't return). - * Otherwise, log errors at LOG level and return -1 to indicate trouble. - * Returns 0 if OK. + * If isServerStart is true, report any errors as FATAL (so we don't return). + * Otherwise, log errors at LOG level and return -1 to indicate trouble, + * preserving the old SSL state if any. Returns 0 if OK. */ int -secure_initialize(bool failOnError) +secure_initialize(bool isServerStart) { #ifdef USE_SSL - return be_tls_init(failOnError); + return be_tls_init(isServerStart); #else return 0; #endif |