--- postgresql-7.2.3/src/interfaces/libpq/fe-connect.c.orig 2001-11-10 19:09:05.000000000 -0700 +++ postgresql-7.2.3/src/interfaces/libpq/fe-connect.c 2002-12-09 05:50:31.000000000 -0700 @@ -138,6 +138,9 @@ "Require-SSL", "", 1}, #endif + {"nossl", "PGNOSSL", "0", NULL, + "No-SSL", "", 1}, + /* Terminating entry --- MUST BE LAST */ {NULL, NULL, NULL, NULL, NULL, NULL, 0} @@ -310,6 +313,16 @@ #ifdef USE_SSL tmp = conninfo_getval(connOptions, "requiressl"); conn->require_ssl = tmp ? (tmp[0] == '1' ? true : false) : false; + + /* requiressl has precedence over nossl */ + if (! conn->require_ssl) + { + if ((tmp = conninfo_getval(connOptions, "nossl")) + && (tmp[0] == '1')) + { + conn->allow_ssl_try = FALSE; + } + } #endif /* @@ -506,6 +519,16 @@ conn->require_ssl = (tmp[0] == '1') ? true : false; else conn->require_ssl = 0; + + /* requiressl has precedence over nossl */ + if (! conn->require_ssl) + { + if (((tmp = getenv("PGNOSSL")) != NULL) + && (tmp[0] == '1')) + { + conn->allow_ssl_try = FALSE; + } + } #endif if (error)