aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunter Knauf <gk@gknw.de>2009-09-21 22:52:59 +0000
committerGunter Knauf <gk@gknw.de>2009-09-21 22:52:59 +0000
commit9448659fc60a272cdd6dec0e2ee18dbadf1e3a88 (patch)
tree9e4770f569a9e31cb3950fa945b06ec0b41688a6
parent40027148255c6fc07c7c6edb059020350a513720 (diff)
added support for new SQLite cert database format: added a runtime check for version 3.12.0, and depending on the result add 'sql:' prefix to cert database directory so that newer SQLIte database format works.
-rw-r--r--lib/nss.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/nss.c b/lib/nss.c
index dbb9a57fa..d6f3fcd89 100644
--- a/lib/nss.c
+++ b/lib/nss.c
@@ -991,8 +991,11 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
rv = NSS_NoDB_Init(NULL);
}
else {
- rv = NSS_Initialize(certDir, NULL, NULL, "secmod.db",
- NSS_INIT_READONLY);
+ char *certpath = PR_smprintf("%s%s",
+ NSS_VersionCheck("3.12.0") ? "sql:" : "",
+ certDir);
+ rv = NSS_Initialize(certpath, "", "", "", NSS_INIT_READONLY);
+ PR_smprintf_free(certpath);
}
if(rv != SECSuccess) {
infof(conn->data, "Unable to initialize NSS database\n");