summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2009-03-28 01:36:11 +0000
committerBruce Momjian2009-03-28 01:36:11 +0000
commita4162f59305766dc8de62a2e7ca3c0b558d4c78d (patch)
treee47fe0a7036d3c59323c1777c6c7f321ad8754d2
parentfbb81122af380a9b34dc806c054841fe3e9ab323 (diff)
Better document PQinitSSL(0) behavior in regards to libcrypto.
-rw-r--r--doc/src/sgml/libpq.sgml12
-rw-r--r--src/interfaces/libpq/fe-secure.c2
2 files changed, 9 insertions, 5 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 68f938b926..0a4e87fe8e 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -6169,11 +6169,13 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
</para>
<para>
- If you are using <acronym>SSL</> inside your application (in addition
- to inside <application>libpq</application>), you can call
- <function>PQinitSSL(int)</> with <literal>0</> to tell
- <application>libpq</application> that the <acronym>SSL</> library
- has already been initialized by your application.
+ If your application initializes <literal>libssl</> or
+ <literal>libcrypto</> libraries and <application>libpq</application>
+ is built with <acronym>SSL</> support, you should call
+ <function>PQinitSSL(0)</> to tell <application>libpq</application>
+ that the <literal>libssl</> and <literal>libcrypto</> libraries
+ have been initialized by your application so
+ <application>libpq</application> will not initialize those libraries.
<!-- If this URL changes replace it with a URL to www.archive.org. -->
See <ulink
url="http://h71000.www7.hp.com/doc/83final/BA554_90007/ch04.html"></ulink>
diff --git a/src/interfaces/libpq/fe-secure.c b/src/interfaces/libpq/fe-secure.c
index 7c229c3efe..e2af1e12d5 100644
--- a/src/interfaces/libpq/fe-secure.c
+++ b/src/interfaces/libpq/fe-secure.c
@@ -870,6 +870,7 @@ init_ssl_system(PGconn *conn)
if (ssl_open_connections++ == 0)
{
+ /* This is actually libcrypto, not libssl. */
/* These are only required for threaded SSL applications */
CRYPTO_set_id_callback(pq_threadidcallback);
CRYPTO_set_locking_callback(pq_lockingcallback);
@@ -934,6 +935,7 @@ destroy_ssl_system(void)
if (ssl_open_connections == 0)
{
+ /* This is actually libcrypto, not libssl. */
/* No connections left, unregister all callbacks */
CRYPTO_set_locking_callback(NULL);
CRYPTO_set_id_callback(NULL);