#include "catalog/pg_collation.h"
#include "libpq/ip.h"
#include "libpq/libpq.h"
+#include "postmaster/postmaster.h"
#include "regex/regex.h"
#include "replication/walsender.h"
#include "storage/fd.h"
if (token[4] == 's') /* "hostssl" */
{
+ /* SSL support must be actually active, else complain */
#ifdef USE_SSL
- parsedline->conntype = ctHostSSL;
+ if (EnableSSL)
+ parsedline->conntype = ctHostSSL;
+ else
+ {
+ ereport(LOG,
+ (errcode(ERRCODE_CONFIG_FILE_ERROR),
+ errmsg("hostssl requires SSL to be turned on"),
+ errhint("Set ssl = on in postgresql.conf."),
+ errcontext("line %d of configuration file \"%s\"",
+ line_num, HbaFileName)));
+ return false;
+ }
#else
ereport(LOG,
(errcode(ERRCODE_CONFIG_FILE_ERROR),