Skip to content

Commit 3ecfdce

Browse files
committed
Issue a log message if a CRL file exists and the SSL library does not
support CRL certificates.
1 parent 25c1c3c commit 3ecfdce

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/backend/libpq/be-secure.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.67 2006/05/04 22:18:38 tgl Exp $
14+
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.68 2006/05/06 01:31:38 momjian Exp $
1515
*
1616
* Since the server static private key ($DataDir/server.key)
1717
* will normally be stored unencrypted so that the database
@@ -795,7 +795,6 @@ initialize_SSL(void)
795795
}
796796
else
797797
{
798-
#ifdef X509_V_FLAG_CRL_CHECK
799798
/*
800799
* Check the Certificate Revocation List (CRL) if file exists.
801800
* http://searchsecurity.techtarget.com/sDefinition/0,,sid14_gci803160,00.html
@@ -804,10 +803,18 @@ initialize_SSL(void)
804803

805804
if (cvstore)
806805
{
806+
/* Set the flags to check against the complete CRL chain */
807807
if (X509_STORE_load_locations(cvstore, ROOT_CRL_FILE, NULL) != 0)
808-
/* setting the flags to check against the complete CRL chain */
809-
X509_STORE_set_flags(cvstore,
808+
/* OpenSSL 0.96 does not support X509_V_FLAG_CRL_CHECK */
809+
#ifdef X509_V_FLAG_CRL_CHECK
810+
X509_STORE_set_flags(cvstore,
810811
X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL);
812+
#else
813+
ereport(LOG,
814+
(errmsg("SSL Certificate Revocation List (CRL) file \"%s\" ignored",
815+
ROOT_CRL_FILE),
816+
errdetail("Installed SSL library does not support CRL.")));
817+
#endif
811818
else
812819
{
813820
/* Not fatal - we do not require CRL */
@@ -817,7 +824,6 @@ initialize_SSL(void)
817824
errdetail("Will not check certificates against CRL.")));
818825
}
819826
}
820-
#endif /* X509_V_FLAG_CRL_CHECK */
821827

822828
SSL_CTX_set_verify(SSL_context,
823829
(SSL_VERIFY_PEER |

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy