Skip to content

Commit 3c4768d

Browse files
committed
Change libpq's PQgetssl() to return a void*, rather than SSL *, so that
applications don't need the SSL headers. Martijn van Oosterhout
1 parent a3c1a11 commit 3c4768d

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

src/interfaces/libpq/fe-secure.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.76 2006/04/27 00:36:34 momjian Exp $
14+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.77 2006/04/27 00:53:58 momjian Exp $
1515
*
1616
* NOTES
1717
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
@@ -1014,9 +1014,9 @@ SSLerrfree(char *buf)
10141014
}
10151015

10161016
/*
1017-
* Return pointer to SSL object.
1017+
* Return pointer to OpenSSL object.
10181018
*/
1019-
SSL *
1019+
void *
10201020
PQgetssl(PGconn *conn)
10211021
{
10221022
if (!conn)

src/interfaces/libpq/libpq-fe.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-fe.h,v 1.126 2006/03/20 15:07:05 momjian Exp $
10+
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-fe.h,v 1.127 2006/04/27 00:53:58 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -28,11 +28,6 @@ extern "C"
2828
*/
2929
#include "postgres_ext.h"
3030

31-
/* SSL type is needed here only to declare PQgetssl() */
32-
#ifdef USE_SSL
33-
#include <openssl/ssl.h>
34-
#endif
35-
3631
/* Application-visible enum types */
3732

3833
typedef enum
@@ -271,12 +266,9 @@ extern int PQbackendPID(const PGconn *conn);
271266
extern int PQclientEncoding(const PGconn *conn);
272267
extern int PQsetClientEncoding(PGconn *conn, const char *encoding);
273268

274-
#ifdef USE_SSL
275-
/* Get the SSL structure associated with a connection */
276-
extern SSL *PQgetssl(PGconn *conn);
277-
#else
269+
/* Get the OpenSSL structure associated with a connection. Returns NULL for
270+
* unencrypted connections or if any other TLS library is in use. */
278271
extern void *PQgetssl(PGconn *conn);
279-
#endif
280272

281273
/* Tell libpq whether it needs to initialize OpenSSL */
282274
extern void PQinitSSL(int do_init);

0 commit comments

Comments
 (0)