Index: fe-secure.c =================================================================== RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v retrieving revision 1.96 diff -c -r1.96 fe-secure.c *** fe-secure.c 2 Oct 2007 00:25:20 -0000 1.96 --- fe-secure.c 2 Oct 2007 09:04:16 -0000 *************** *** 607,612 **** --- 607,626 ---- /* read the user certificate */ snprintf(fnbuf, sizeof(fnbuf), "%s/%s", homedir, USER_CERT_FILE); + + /* + * OpenSSL <= 0.8.2 lacks error stack handling. Do a separate check + * for the existance of the file without using BIO functions to make + * it pick up the majority of the cases with the old versions. + */ + if (stat(fnbuf, &buf) == -1) + { + printfPQExpBuffer(&conn->errorMessage, + libpq_gettext("could not open certificate file \"%s\": %s\n"), + fnbuf, pqStrerror(errno, sebuf, sizeof(sebuf))); + return 0; + } + if ((bio = BIO_new_file(fnbuf, "r")) == NULL) { printfPQExpBuffer(&conn->errorMessage,