PQgetssl has been discouraged from use since postgres 9.5 since it
will risk false negatives if postgres supports other TLS libraries
than OpenSSL. Refactor to use PQsslInUse which has been available
since 9.5 for just this purpose.
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS(strtoul strtoll strlcat mbstowcs wcstombs mbrtoc16 c16rtomb)
+AC_CHECK_FUNCS(PQsslInUse)
+
if test "$enable_pthreads" = yes; then
AC_CHECK_FUNCS(localtime_r strtok_r pthread_mutexattr_settype)
/*
* Did we use SSL client certificate, SSPI, Kerberos or similar
* authentication methods?
- * There seems no way to check it directly.
*/
doubtCert = FALSE;
+#ifdef HAVE_PQSSLINUSE
+ if (PQsslInUse(conn->pqconn))
+#else
if (PQgetssl(conn->pqconn) != NULL)
+#endif
doubtCert = TRUE;
nameSize = sizeof(loginUser);