diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 23c77ab050..9b6aa7fe74 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -965,6 +965,19 @@ include_dir 'conf.d' + + ssl_loaded (boolean) + + ssl_loaded configuration parameter + + + + + Reports whether the SSL context is loaded for this cluster or not. + + + + ssl_ca_file (string) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 943796ac7f..e1f5dad948 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -936,6 +936,14 @@ PostmasterMain(int argc, char *argv[]) (void) secure_initialize(true); LoadedSSL = true; } + + /* + * Make LoadedSSL value visible as a GUC variable, too. This allows + * other backends to track the activity of this parameter after being + * spawned. + */ + SetConfigOption("ssl_loaded", LoadedSSL ? "yes" : "no", + PGC_INTERNAL, PGC_S_OVERRIDE); #endif /* @@ -2531,6 +2539,14 @@ SIGHUP_handler(SIGNAL_ARGS) secure_destroy(); LoadedSSL = false; } + + /* + * Make LoadedSSL value visible as a GUC variable, too. This allows + * other backends to track the activity of this parameter after being + * spawned. + */ + SetConfigOption("ssl_loaded", LoadedSSL ? "yes" : "no", + PGC_INTERNAL, PGC_S_OVERRIDE); #endif #ifdef EXEC_BACKEND diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 2478f0afac..7e973c90f7 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -509,6 +509,7 @@ static int block_size; static int segment_size; static int wal_block_size; static bool data_checksums; +static bool ssl_loaded; static int wal_segment_size; static bool integer_datetimes; static bool assert_enabled; @@ -1644,6 +1645,17 @@ static struct config_bool ConfigureNamesBool[] = }, { + {"ssl_loaded", PGC_INTERNAL, PRESET_OPTIONS, + gettext_noop("Shows whether SSL context is loaded for this cluster or not."), + NULL, + GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE + }, + &ssl_loaded, + false, + NULL, NULL, NULL + }, + + { {"syslog_sequence_numbers", PGC_SIGHUP, LOGGING_WHERE, gettext_noop("Add sequence number to syslog messages to avoid duplicate suppression."), NULL