Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78ab803

Browse files
committed
Don't bother to request SSL connection over a Unix socket, since the
postmaster won't accept the request anyway. (If your kernel can'tbe trusted, SSL will not help you.)
1 parent608d843 commit78ab803

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎src/interfaces/libpq/fe-connect.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.181 2001/11/11 02:09:05 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.182 2002/03/02 00:49:22 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -309,7 +309,8 @@ PQconnectStart(const char *conninfo)
309309
conn->pgpass=tmp ?strdup(tmp) :NULL;
310310
#ifdefUSE_SSL
311311
tmp=conninfo_getval(connOptions,"requiressl");
312-
conn->require_ssl=tmp ? (tmp[0]=='1' ? true : false) : false;
312+
if (tmp&&tmp[0]=='1')
313+
conn->require_ssl= true;
313314
#endif
314315

315316
/*
@@ -504,8 +505,6 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
504505
#ifdefUSE_SSL
505506
if ((tmp=getenv("PGREQUIRESSL"))!=NULL)
506507
conn->require_ssl= (tmp[0]=='1') ? true : false;
507-
else
508-
conn->require_ssl=0;
509508
#endif
510509

511510
if (error)
@@ -871,6 +870,11 @@ connectDBStart(PGconn *conn)
871870
{
872871
UNIXSOCK_PATH(conn->raddr.un,portno,conn->pgunixsocket);
873872
conn->raddr_len=UNIXSOCK_LEN(conn->raddr.un);
873+
#ifdefUSE_SSL
874+
/* Don't bother requesting SSL over a Unix socket */
875+
conn->allow_ssl_try= false;
876+
conn->require_ssl= false;
877+
#endif
874878
}
875879
#endif
876880

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp