index f25505feb385f62b54d9b29654f8fab93c1ad375..2aaa898a6bf23da0abe0af8d866c67827674bc19 100644 (file)
#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"
@@ -832,8 +833,20 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
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),